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

Support configuration of schemas for complex types #1609

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

MikeEdgar
Copy link
Member

Fixes #1600

Support more complex types (besides simply a fully-qualified class name required by the MP TCK) when using the mp.openapi.schema. configuration prefix.

For example, to support a field of type JsonNullable<String> mentioned in the issue, the following could be configured:

mp.openapi.schema.org.openapitools.jackson.nullable.JsonNullable<java.lang.String>={ \
  "name": "JsonNullableString", \
  "type": "string", \
  "nullable": true, \
  "description": "A string that may be nullable!" \
}

This configuration would result in all usages of JsonNullable<String> being set to a $ref of #/components/schemas/JsonNullableString.

@MikeEdgar MikeEdgar added this to the 3.7.0 milestone Oct 11, 2023
@MikeEdgar
Copy link
Member Author

PR needs some cleanup and a few more tests, but generally done.

@melloware, please comment if you do not think this would cover your use case.

@melloware
Copy link

Gotcha so for Booleans I could do...

mp.openapi.schema.org.openapitools.jackson.nullable.JsonNullable<java.lang.Boolean>={ \
  "name": "JsonNullableBoolean", \
  "type": "boolean", \
  "nullable": true, \
  "description": "A boolean that may be nullable!" \
}

@MikeEdgar
Copy link
Member Author

That's right. New-lines are only to make it easier to read and aren't required, just FYI

@melloware
Copy link

This is good with me!

@MikeEdgar MikeEdgar marked this pull request as ready for review October 11, 2023 23:54
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

91.8% 91.8% Coverage
0.0% 0.0% Duplication

@MikeEdgar MikeEdgar merged commit 3fd711c into smallrye:main Oct 12, 2023
8 checks passed
@MikeEdgar MikeEdgar deleted the issue-1600 branch October 26, 2023 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quarkus: Custom ObjectMapper
3 participants