Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate reflection declaration from MP OpenAPI schema definition #1389

Merged
merged 1 commit into from
Mar 15, 2019

Conversation

machi1990
Copy link
Member

@machi1990 machi1990 commented Mar 11, 2019

Fixes #745.

The main idea is to scan for SCHEMA annotation and mark them as ReflectiveHierarchy
-Scan APIResponse annotation for schema declaration and mark the results ( implementation , not, oneOf, anyOf, allOf values) for reflection.
-Scan APIResponses annotation and do as above.

@dmlloyd
Copy link
Member

dmlloyd commented Mar 11, 2019

Could you please provide a descriptive PR summary? It's OK to have "Fixes..." in the body but the title should say what the PR is actually for.

@machi1990 machi1990 changed the title Fixes #745 Fixes #745: Generate reflection declaration from MP OpenAPI schema definition Mar 11, 2019
@machi1990
Copy link
Member Author

@dmlloyd I have renamed the PR. Should the same be done for the commit message?

@gsmet gsmet added the kind/enhancement New feature or request label Mar 11, 2019
@gsmet gsmet self-assigned this Mar 11, 2019
@dmlloyd
Copy link
Member

dmlloyd commented Mar 11, 2019

@dmlloyd I have renamed the PR. Should the same be done for the commit message?

Yes please.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@machi1990 I added another round of comments. We're nearly there!

@gsmet
Copy link
Member

gsmet commented Mar 12, 2019

@machi1990 I let you finish this? Looks like we just need some minor adjustments to the constants and the tests, now.

@machi1990
Copy link
Member Author

@machi1990 I let you finish this? Looks like we just need some minor adjustments to the constants and the tests, now.

@gsmet looks like we are good. I do not understand why the build is failing on the CI though.

@machi1990 machi1990 force-pushed the fix-745 branch 2 times, most recently from b5b6795 to 8f5e644 Compare March 13, 2019 13:08
@machi1990
Copy link
Member Author

@machi1990 I let you finish this? Looks like we just need some minor adjustments to the constants and the tests, now.

@gsmet looks like we are good. I do not understand why the build is failing on the CI though.

@machi1990 machi1990 closed this Mar 13, 2019
@machi1990 machi1990 reopened this Mar 13, 2019
@machi1990 machi1990 force-pushed the fix-745 branch 2 times, most recently from 80268ef to 016f870 Compare March 14, 2019 08:41
@machi1990
Copy link
Member Author

@gsmet I have finished integrating the requested changes and rebased the branch with master. This is ready for another round of review.

@gsmet
Copy link
Member

gsmet commented Mar 14, 2019

Thanks, it's on my TODO list for today.

@gsmet
Copy link
Member

gsmet commented Mar 15, 2019

@machi1990 I just force pushed a rebase to hopefully get CI working correctly. Review planned for later today.

public void testOpenApiSchemaResponse() {
RestAssured.when().get("/test/openapi/responses").then()
.body("name", is("my openapi entity name"));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not testing the "/openapi/responses/{version}" path.

Otherwise, it looks good.

Could you rebase and take care of it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I have rebased the master and force pushed to the branch.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

I'll wait for CI to go green and merge.

@machi1990
Copy link
Member Author

Thanks to you too. I can contribute to something else if need be.

@gsmet gsmet added this to the 0.12.0 milestone Mar 15, 2019
@kenfinnigan
Copy link
Member

Coming late to this, but wondering whether it makes sense for this to be done as part of the quarkus-smallrye-openapi extension?

Mostly because if you're using MP OpenAPI annotations, without adding that dependency yourself you're only going to have that if the quarkus-smallrye-openapi extension is installed.

@gsmet gsmet merged commit c342824 into quarkusio:master Mar 15, 2019
@gsmet
Copy link
Member

gsmet commented Mar 15, 2019

@kenfinnigan Aaaah... sorry, just saw your message when I clicked the Merge button as I was waiting for this to go green.

So the rationale was to try to centralize the serialization reflection registration so that we have a global view of what's going on in the RESTEasy extension.

That's something we can discuss for sure, we can move the code if needed.

@kenfinnigan
Copy link
Member

Just seems odd for RESTEasy extension to need to know about OpenAPI, and potentially lots of other things

@machi1990 machi1990 deleted the fix-745 branch March 15, 2019 20:29
@machi1990
Copy link
Member Author

Oops, I too moved a bit fast and deleted my local branch.

I think @kenfinnigan is making a interesting point, and thanks to @gsmet for giving an element of response to the case. I took this approach for the reason stated above. Should we decide to move the code to quarkus-smallrye-openapi extension, I'll be up for the task.

@gsmet
Copy link
Member

gsmet commented Mar 15, 2019

@machi1990 Yeah, maybe let's do that.

It shouldn't be too much of a hassle: you should move the code in the processor (and use the annotation classes as they will be in the classpath now). The tests can stay as they are.

@cescoffier cescoffier changed the title Fixes #745: Generate reflection declaration from MP OpenAPI schema definition Generate reflection declaration from MP OpenAPI schema definition Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants