Closed andriy-dmytruk closed 6 months ago
I think for serving schemas is best to recommend users to use the Static Resources support as we do for OpenAPI instead of creating a controller.
I tried this using it, but there is a small problem. The schema URL (id) generally omits the .schema.json
extension: https://json-schema.org/understanding-json-schema/structuring#id. The controller has a minor change of adding the extension if needed. If we could somehow solve this with static resources, that would be better, though.
Other changes look good. Thanks, Sergio!
Other changes look good. Thanks, Sergio!
Yes, I have another PR in progress. I wanted to send it today. But I will send it tomorrow.
@sdelamo Do we want to merge this now and send PRs for new fixes/features to master? At this point the PR is pretty large
Failed conditions
7.5% Coverage on New Code (required ≥ 70%)
1 New Bugs (required ≤ 0)
1 New Blocker Issues (required ≤ 0)
6 New Critical Issues (required ≤ 0)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension SonarLint
Based on the proposal in this issue: https://github.com/micronaut-projects/micronaut-json-schema/issues/2.
The implementation includes a visitor that visits types that require a JSON schema and generates the files during build time.
Global configuration is available with the
JsonSchemaConfiguration
annotation.