Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Add raml-to-jaxrs article example proj and base #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

postatum
Copy link
Contributor

200:
body:
application/json:
type: Rick
Copy link
Contributor

@jstoiko jstoiko Jun 6, 2018

Choose a reason for hiding this comment

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

why not re-sure RicksLib.Rick here? I understand it has something to do with jsonschema2pojo but what would happen if it was a RAML type instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just a way to showcase that JSON Schema and RAML Data Type can be used alongside. RicksLib.Rick can be used in all places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please let me know if I should remove JSON Schema and use RicksLib.Rick instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

would it generate similar java code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like generated files (inside raml-playground/raml-for-jaxrs/example-proj/target/generated-sources/raml-to-jaxrs-maven-plugin/example/jsonschema/) are identical.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, let's use only the type Lib.Rick

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh, I was wrong. On previous test everything work fine, but then I removed generated code folder completely and tried to install the project. And now looks like class Rick (inside /raml-playground/raml-for-jaxrs/example-proj/target/generated-sources/raml-to-jaxrs-maven-plugin/example/jsonschema/Rick.java) implementation is not generated when JSON Schema is not used 😕

Choose a reason for hiding this comment

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

Both classes had the same name (json and raml). In the pull request I submitted to @postatum, I changed the name from Rick to JsonRick. That said, I'm not convinced in a small example that we should be using JsonSchema: jsonschema is a bit of an outlier in RAML (arrays and such are not handled the same way...). And the project itself has examples of this.

I've also made the project standalone: no parent in the pom.xml, everything explicitly stated.

jpbelang and others added 3 commits June 16, 2018 11:06
Fix some conflicts in classnames.
Fix some conflicts in classnames.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants