-
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
Generate schemas in yml format? #384
Comments
Hi @takanuva15, I'm glad the library is of use to you. Either way, I'm open for a Pull Request. 😃 |
Thx for the quick reply. I'll have to see when I can find some time to look at the library internals for implementation lol. In terms of "how to declare it", I was thinking that the SchemaConfigBuilder can define a method |
The That'd work, yes. It's somewhat unfortunate to have two ways of configuring it then, but that can't be helped without breaking backward compatibility I suppose. |
Release v4.32.0 has been published, including this change. |
Hi, thanks for this great library! I am using the schema autogeneration example here which is perfect for the json validation I am doing in my integration tests. I noticed that all the schemas are generated in json format, which is clunkier than the yml schemas that I'm used to. Is it possible to configure the plugin to generate the json-schema files in yaml format?
For reference, the jackson ObjectMapper I'm using in my code can read yml schema files easily with this configuration:
EDIT: I did some more research and I found that the maven plugin writes the jsonSchema to file in this method within
SchemaGeneratorMojo.java
:Can we configure this line
writer.print(jsonSchema.toPrettyString());
to instead accept any custom ObjectMapper specified by the user to do the writing? I see that theSchemaGeneratorConfigBuilder
has an objectmapper associated with it - could we customize that and then use that for the writing so that I can adjust the objectmapper to print out yaml viaobjectMapper.writeValueAsString(...)
?The text was updated successfully, but these errors were encountered: