-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: add withObjectMapper
method to customize serialization of schemas to file
#388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this PR 🙇
To answer your questions:
- The general logic fine, yes. I just added two minor comments. I have no particular test classes in mind, but yes the
SchemaGeneratorConfigBuilderTest
would be good for completeness' sake. The change is not that big I suppose. - I can take care of the documentation afterward. For reference though, it's defined as markdown files in the
slate-docs/source/includes
directory of this repository. - Examples for the Maven plugin are somewhat tricky in the
jsonschema-examples
scope. An example of using YAML as the output format would be good to include in the FAQs of the documentation I suppose. Feel free to add it yourself, otherwise, I'll do it later.
...schema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaGenerator.java
Outdated
Show resolved
Hide resolved
...en-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java
Outdated
Show resolved
Hide resolved
...en-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java
Show resolved
Hide resolved
Thanks for the reply. I've updated the PR and left the documentation untouched. This change is really only relevant to the maven plugin, because if a dev is manually making their own schema through the builder, then they'll have access to the root JsonNode and can serialize it however they want. In that sense, perhaps the documentation would make more sense to go under |
...schema-generator/src/main/java/com/github/victools/jsonschema/generator/SchemaGenerator.java
Outdated
Show resolved
Hide resolved
...tor/src/main/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfigBuilder.java
Outdated
Show resolved
Hide resolved
...tor/src/main/java/com/github/victools/jsonschema/generator/SchemaGeneratorConfigBuilder.java
Outdated
Show resolved
Hide resolved
...en-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java
Outdated
Show resolved
Hide resolved
...en-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java
Outdated
Show resolved
Hide resolved
...en-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java
Outdated
Show resolved
Hide resolved
...lugin/src/test/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojoTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good now.
Adding this to the documentation of the Maven plugin is a fair point.
Users are more likely to find it there than in the FAQs.
I'll do that in a separate PR then.
Thank you for this contribution. 😄👍
Hi, I put together this rough PR based on our discussion in #384.
3 quick questions on this:
SchemaGeneratorConfigBuilderTest.java
).