Displaying #apache-syncope/2017-12-27.log:

Wed Dec 27 03:56:39 2017  syncope-bot:Joined the channel
Wed Dec 27 04:53:04 2017  syncope-bot_:Joined the channel
Wed Dec 27 07:18:13 2017  ilgrosso:Joined the channel
Wed Dec 27 07:56:27 2017  andreapatricelli:Joined the channel
Wed Dec 27 08:23:01 2017  svizzero81:Joined the channel
Wed Dec 27 10:30:35 2017  sberyozkin:Joined the channel
Wed Dec 27 11:03:00 2017  ilgrosso:hi sberyozkin I hope you're doing fine
Wed Dec 27 11:03:20 2017  ilgrosso:as I see you connected here I guess you're not on holiday, right? :-)
Wed Dec 27 11:03:58 2017  sberyozkin:ilgrosso: hi Francesco, happy holidays to you :-). Yes, working the next 3 days, off to Belarus on 2nd Jan
Wed Dec 27 11:04:52 2017  sberyozkin:ilgrosso: saw your email re Swagger2Feature, going to add more tests
Wed Dec 27 11:05:09 2017  sberyozkin:ilgrosso: or rather, open api...
Wed Dec 27 11:05:16 2017  ilgrosso:sberyozkin: thx! I hope what I wrote makes sense
Wed Dec 27 11:05:34 2017  sberyozkin:ilgrosso: yes, indeed
Wed Dec 27 11:05:41 2017  ilgrosso:looking fwd for the full OpenAPI 3.0 support anyway
Wed Dec 27 11:06:25 2017  ilgrosso:sberyozkin: let me know if I can help somehow - don't have much time these days, but the topic is interesting
Wed Dec 27 11:07:24 2017  sberyozkin:ilgrosso: sure, I'll test why swagger.json is blocked first
Wed Dec 27 12:21:11 2017  sberyozkin:ilgrosso: swagger.json is generated OK for me. Do you have it empty when the SwaggerToOpenApiConversionTest is registered ?
Wed Dec 27 12:21:33 2017  ilgrosso:sberyozkin: when SwaggerToOpenApiConversion is registered, you mean?
Wed Dec 27 12:21:42 2017  ilgrosso:anyway, yes I have it blank
Wed Dec 27 12:22:58 2017  sberyozkin:ilgrosso: so you have it blank when the filter is registered ?
Wed Dec 27 12:23:09 2017  ilgrosso:yep
Wed Dec 27 12:23:20 2017  ilgrosso:no errors in the logs
Wed Dec 27 12:23:25 2017  ilgrosso:but it's just blank
Wed Dec 27 12:23:56 2017  sberyozkin:ilgrosso: do you also have the new OpenApiFeature reg-ed ?
Wed Dec 27 12:24:31 2017  ilgrosso:sberyozkin: I've followed https://cwiki.apache.org/confluence/display/CXF20DOC/Swagger2Feature#Swagger2Feature-ConvertingtoOpenAPIJSON
Wed Dec 27 12:24:43 2017  ilgrosso:hence I only registered SwaggerToOpenApiConversionFilter
Wed Dec 27 12:26:31 2017  sberyozkin:ilgrosso: https://github.com/apache/cxf/blob/master/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionFilter.java
Wed Dec 27 12:26:47 2017  sberyozkin:ilgrosso: I can't see how it can affect the /swagger.jsin queries
Wed Dec 27 12:27:26 2017  ilgrosso:sberyozkin: maybe I did something wrong with registration? in any case, openapi.json was generated
Wed Dec 27 12:27:39 2017  sberyozkin:ilgrosso: it is only effective if openapi.json is gen-ed
Wed Dec 27 12:27:56 2017  sberyozkin:ilgrosso: if it is requested...
Wed Dec 27 12:28:28 2017  ilgrosso:I see, and I'll try again to be sure, but could it be possible that, once openapi.json is requested, swagger.json is not served any more?
Wed Dec 27 12:30:01 2017  sberyozkin:ilgrosso: I'll try... Though in the case of the filter it converts swagger.json to openapi.json...
Wed Dec 27 12:38:57 2017  ilgrosso:sberyozkin: let me try again
Wed Dec 27 12:41:39 2017  sberyozkin:ilgrosso: seems to work for me one, after another, will commit now
Wed Dec 27 12:45:43 2017  ilgrosso:sberyozkin: ok, I've reproduced it
Wed Dec 27 12:47:02 2017  ilgrosso:take syncope sources, branch 2_0_X and apply the diff https://paste.apache.org/Sc4C
Wed Dec 27 12:47:25 2017  ilgrosso:maybe I am doing bad the filter registration...
Wed Dec 27 12:47:40 2017  sberyozkin:ilgrosso: is it cxf 3.1.15-SNAPSHOT ?
Wed Dec 27 12:48:00 2017  ilgrosso:sberyozkin: anyway, it's empty /syncope/rest/swagger.json and populated /syncope/rest/openapi.json
Wed Dec 27 12:48:12 2017  ilgrosso:(but with troubles with Swagger UI 3.0 as reported in the e-mail)
Wed Dec 27 12:48:40 2017  ilgrosso:sberyozkin: yes, you can see that from the diff
Wed Dec 27 12:51:05 2017  sberyozkin:ilgrosso: oh, I recall there was something broken in 3.1.x when I was back merging, so I had to reimplement the filter in 3.1.x
Wed Dec 27 12:52:12 2017  ilgrosso:sberyozkin: I see one difference, indeed
Wed Dec 27 12:52:18 2017  ilgrosso:master is https://github.com/apache/cxf/blob/master/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionFilter.java#L45
Wed Dec 27 12:52:32 2017  ilgrosso:3.1.x is https://github.com/apache/cxf/blob/3.1.x-fixes/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionFilter.java#L52
Wed Dec 27 12:53:13 2017  ilgrosso:and the filter() method, of course from master
Wed Dec 27 12:53:31 2017  ilgrosso:which is aroundWriteTo() in 3.1.x
Wed Dec 27 12:54:12 2017  ilgrosso:ah, I see it's because 3.1.x implements WriterInterceptor while master implements ContainerResponseFilter
Wed Dec 27 12:55:40 2017  ilgrosso:sberyozkin: shall I check also with Syncope master branch (which uses CXF 3.2.x)?
Wed Dec 27 12:55:47 2017  sberyozkin:ilgrosso: yes, in 3.1.x Swagger lib does not return a String, it uses its own MessageBodywriter, so I had to intercept at that level
Wed Dec 27 12:55:55 2017  sberyozkin:ilgrosso: please
Wed Dec 27 12:56:25 2017  ilgrosso:sberyozkin: let me do...
Wed Dec 27 12:56:25 2017  ilgrosso:anyway, could it be a problem that in Syncope 2_0_X we do use Swagger 1.5.17 (and not 1.5.16 as CXF 3.1.x does)?
Wed Dec 27 12:57:14 2017  sberyozkin:ilgrosso: might be. Let me tweak few things
Wed Dec 27 12:57:31 2017  ilgrosso:sberyozkin: in the meanwhile, I'll try with CXF 3.2.2-SNAPSHOT on Syncope master
Wed Dec 27 12:57:42 2017  sberyozkin:ilgrosso: sounds good
Wed Dec 27 13:02:55 2017  ilgrosso:sberyozkin: Syncope master / CXF 3.2.2-SNAPSHOT works fine
Wed Dec 27 13:03:08 2017  ilgrosso:both openapi.json and swagger.json are returned
Wed Dec 27 13:05:28 2017  sberyozkin:ilgrosso: good. so it might be Swagger 1.5.17 in 3.1.x I guess
Wed Dec 27 13:05:43 2017  sberyozkin:ilgrosso: I'll adapt the code a bit now
Wed Dec 27 13:05:48 2017  ilgrosso:sberyozkin: shall I try with 1.5.16 or are you going to use 1.5.17 in CXF 3.1.x?
Wed Dec 27 13:06:45 2017  sberyozkin:ilgrosso: cxf will depend on 1.5.16 itself, there were some issues with 1.5.17 in osgi, but I'll just update the filter to check for String
Wed Dec 27 13:06:47 2017  sberyozkin:too
Wed Dec 27 13:06:56 2017  ilgrosso:sberyozkin: ah, great
Wed Dec 27 13:07:06 2017  ilgrosso:once you've done, I'll rebuild CXF locally and try again
Wed Dec 27 13:18:30 2017  sberyozkin:ilgrosso: I've just deployed the updated 3.1.x filter
Wed Dec 27 13:18:39 2017  sberyozkin:ilgrosso: try it please
Wed Dec 27 13:18:56 2017  ilgrosso:sberyozkin: I'll do that straight away
Wed Dec 27 13:19:02 2017  sberyozkin:thanks
Wed Dec 27 13:25:36 2017  ilgrosso:sberyozkin: with the latest changes, I now get empty responses for both openapi.json and swagger.json :-/
Wed Dec 27 13:33:26 2017  sberyozkin:ilgrosso: can you try once more please. just did another tweak
Wed Dec 27 13:40:55 2017  ilgrosso:sberyozkin: doing that right now
Wed Dec 27 13:42:04 2017  ilgrosso:sberyozkin: still both empty...
Wed Dec 27 13:46:58 2017  sberyozkin:ilgrosso: sorry, don't really understand...Can you try breakpoint at https://github.com/apache/cxf/blob/3.1.x-fixes/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionFilter.java#L70 and https://github.com/apache/cxf/blob/3.1.x-fixes/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionFilter.java#L90, just to even make sure it is the source
Wed Dec 27 13:46:58 2017  sberyozkin:which is executing
Wed Dec 27 13:47:37 2017  ilgrosso:sberyozkin: let me check..
Wed Dec 27 13:51:00 2017  ilgrosso:sberyozkin: when requesting swagger.json, I see isOpenApiRequested() FALSE and (responseContext.getEntity() instanceof String) TRUE - hence line #90 is false
Wed Dec 27 13:51:07 2017  ilgrosso:also line #70
Wed Dec 27 13:52:36 2017  ilgrosso:when requesting openapi.json, instead line #90 is true (then the if body is executed) but then line #70 nis false
Wed Dec 27 13:57:24 2017  sberyozkin:ilgrosso: so, the openapi gen does not work if it is created at the container request filer
Wed Dec 27 13:57:32 2017  sberyozkin:ilgrosso: in 3.1.x
Wed Dec 27 13:58:14 2017  ilgrosso:sberyozkin: yes, because even if isOpenApiRequested() is true at line 90, then it is reset by line 94
Wed Dec 27 13:58:30 2017  ilgrosso:(because of line 84)
Wed Dec 27 13:58:49 2017  ilgrosso:and check at line 70 fails
Wed Dec 27 13:59:38 2017  sberyozkin:ilgrosso: the idea there that openapi.json then is not generated at the writer level because the conversion is already done...Hmmm... I'll just revert
Wed Dec 27 14:03:34 2017  sberyozkin:ilgrosso: sorry, reverted, something apparently is not liked by swagger 1.5.17 with cxf 3.1.x
Wed Dec 27 14:04:39 2017  ilgrosso:sberyozkin: ok - we'll wait for the actual OpenAPIFeature then
Wed Dec 27 14:04:53 2017  ilgrosso:do you think it will take some time?
Wed Dec 27 14:05:55 2017  sberyozkin:ilgrosso: it is not in 3.1.x as far as I know, may be comment on the JIRA and ask Andriy to merge to 3.1.x somehow
Wed Dec 27 14:06:40 2017  ilgrosso:sberyozkin: sure
Wed Dec 27 14:06:55 2017  sberyozkin:ilgrosso: try it please with 3.2.2-SNAPSHOT, see if it already works as expected
Wed Dec 27 14:07:22 2017  ilgrosso:sberyozkin: do you mean about the other troubles reported?
Wed Dec 27 14:07:32 2017  ilgrosso:e.g. 2. openapi.json generates incorrect "servers" element, as swagger.json
Wed Dec 27 14:07:32 2017  ilgrosso: does not currently include host name
Wed Dec 27 14:07:32 2017  ilgrosso:3. while it seems that Swagger UI 3.0 loads it correctly, the browser's
Wed Dec 27 14:07:32 2017  ilgrosso: console shows several errors
Wed Dec 27 14:07:55 2017  ilgrosso:don't think (2) is really a problem, I can fix it in CXF code too
Wed Dec 27 14:08:01 2017  ilgrosso:but (3) looks more involved
Wed Dec 27 14:08:05 2017  sberyozkin:ilgrosso: re that 'host' issue. is it not included in the generated swagger.json ?
Wed Dec 27 14:08:18 2017  ilgrosso:the swagger.json is relative URL
Wed Dec 27 14:08:26 2017  ilgrosso:(in our case)
Wed Dec 27 14:08:40 2017  ilgrosso:so links get adjusted depending on the browser's access URL
Wed Dec 27 14:08:58 2017  ilgrosso:this is not currently handled by the converter
Wed Dec 27 14:09:18 2017  sberyozkin:ilgrosso: no, I meant try OpenApiFeature with 3.2.2-SNAPSHOT
Wed Dec 27 14:09:23 2017  ilgrosso:ah ok
Wed Dec 27 14:11:47 2017  ilgrosso:sberyozkin: FYI, with your latest changes (e.g. revert), I have now back openapi.json working and empty swagger.json - but this happens also with swagger 1.5.16
Wed Dec 27 14:12:16 2017  ilgrosso:I'd say I'll give up with such approach and concentrate on OpenApiFeature
Wed Dec 27 14:16:10 2017  sberyozkin:ilgrosso: yes, something us not wiring up at the 3.1.x level
Wed Dec 27 14:16:59 2017  sberyozkin:ilgrosso: given that it works Ok in 3.2.x
Wed Dec 27 14:21:40 2017  sberyozkin:ilgrosso: can you please do one more try. With CXF 3.1.x, and this filter, what happens if you request swagger.json first ?
Wed Dec 27 14:22:10 2017  ilgrosso:sberyozkin: I've done this check before, it empty anyway
Wed Dec 27 14:22:15 2017  ilgrosso:*it's
Wed Dec 27 14:24:37 2017  sberyozkin:ilgrosso: I know what it is, few secs :-)
Wed Dec 27 14:24:49 2017  ilgrosso:sberyozkin: cool!
Wed Dec 27 14:33:53 2017  sberyozkin:ilgrosso: fixed now, and deployed. Trivial bug, I got lazy. 3.2.x has a complete test but in 3.1.x it was not working, apparently due to to older Swagger libs generating slightly less conformant/etc json, so the conversion was perhaps a bit flaky
Wed Dec 27 14:34:28 2017  sberyozkin:ilgrosso: so. in 3.1.x the conversion will likely need more tweaks, may be in 3.2.x as well...
Wed Dec 27 15:11:07 2017  ilgrosso:sberyozkin: I confirm your latest fix works fine with CXF 3.1.x - both swagger.json and openapi.json are generated
Wed Dec 27 15:11:29 2017  ilgrosso:sberyozkin: I've tried OpenApiFeature and reported at https://issues.apache.org/jira/browse/CXF-7525?focusedCommentId=16304585&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16304585
Wed Dec 27 15:11:30 2017  sberyozkin:ilgrosso: woo-hoo
Wed Dec 27 15:11:52 2017  ilgrosso:sberyozkin: looks like OpenApiFeature is way less complete than Swagger2Feature
Wed Dec 27 15:12:42 2017  sberyozkin:ilgrosso: it will take a bit of time I guess, that is why I started with the conversion as a short=term workaround
Wed Dec 27 15:16:04 2017  ilgrosso:sberyozkin: I still have the main blocker with converter
Wed Dec 27 15:16:23 2017  ilgrosso:if you go to http://petstore.swagger.io/ and put http://rovere.tirasa.net/~ilgrosso/new.json, then several errors are reported
Wed Dec 27 15:16:33 2017  ilgrosso:like as 'Resolver error at paths./accessTokens.get.responses.200.content.application/json.schema.properties.result.items.$ref
Wed Dec 27 15:16:33 2017  ilgrosso:Could not resolve reference because of: Could not resolve pointer: /definitions/AccessTokenTO does not exist in document'
Wed Dec 27 15:17:14 2017  ilgrosso:the new.json file was just generated by Syncope via the OpenApi converter
Wed Dec 27 15:17:29 2017  ilgrosso:(put there just to make it reachable from petstore)
Wed Dec 27 15:20:10 2017  sberyozkin:ilgrosso: can you please paste there the swagger.json, and I'll experiment with it
Wed Dec 27 15:20:39 2017  sberyozkin:ilgrosso: to make sure the goo openapi.json is gen-ed
Wed Dec 27 15:21:18 2017  ilgrosso:sberyozkin: here it is http://syncope-vm.apache.org:9080/syncope/rest/swagger.json
Wed Dec 27 15:22:27 2017  ilgrosso:the Swagger UI error messages refer to "Could not resolve pointer: /definitions/AccessTokenTO" but I don't see "definitions" at all, in http://rovere.tirasa.net/~ilgrosso/new.json
Wed Dec 27 15:22:56 2017  ilgrosso:closest match is /components/schemas - not sure how it should be
Wed Dec 27 15:25:17 2017  ilgrosso:maybe it's just the Swagger UI version at http://petstore.swagger.io/ which is old / buggy
Wed Dec 27 15:27:20 2017  sberyozkin:ilgrosso: ok, saved syncope.json, will be experimenting with it...Most likely it is the conversion, I'll have a look
Wed Dec 27 15:28:03 2017  ilgrosso:sberyozkin: maybe it's worth trying with latest Swagger UI (3.8.0) rather than petstore.io - cannot find which version is live there
Wed Dec 27 15:30:04 2017  sberyozkin:ilgrosso: I'll still need to try the conversion...
Wed Dec 27 15:30:08 2017  ilgrosso:sberyozkin: nope, I get the same errors when downloading from https://github.com/swagger-api/swagger-ui/releases and running locally
Wed Dec 27 15:30:43 2017  sberyozkin:ilgrosso: will be rebooting the laptop, be back in few mins
Wed Dec 27 15:35:33 2017  sberyozkin:Joined the channel

Comments