-
Notifications
You must be signed in to change notification settings - Fork 83
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 defining "additionalProperties" in @Schema annotation #423
Comments
We talked about this a little bit on the spec hangout call today. Clearly the My question for @knutwannheden is this: what is your particular use-case? A Can you give us an example of what you're doing? |
My background is that we have a large set of JavaEE services annotated using swagger-core 1.5 annotations which we are now migrating to MicroProfile OpenAPI. In the existing code we have many cases where we are using I was now reading the specs trying to figure out how to best map this to MicroProfile OpenAPI annotations and AFAICT https://swagger.io/docs/specification/data-models/dictionaries/ suggests that the |
So in that case you are definitely looking for the more complex variant of One thing you could consider doing is defining a re-usable named There are probably other approaches you could take too. Thoughts on other options, @MikeEdgar ? |
One other option might be to define a dummy class that contains the type information, then use that as the
Then: @APIResponse(
responseCode = "200",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = YourTypeMap.class))) |
@MikeEdgar I'm facing the same issue (having used
This seems to be the output, regardless of the map's key/value types, e.g.:
Am I missing something here? |
@flo-ryan , you're right - I was just spit balling that answer and it turns out not to work (at least in SmallRye). You might try to put a dummy Longer term for the next release (2.1?), perhaps
Any thoughts on this, @EricWittmann, @phillip-kruger, @msmiths ? |
Hi guys, we are also in need to have the support of additionalProperties: true in the Schema annotation. Do we have any plan recently for adding this? Thank you. |
@effywu - I think once version 2.0 is released we will be able to take a more serious look at things like this. |
Hi, any news on this? |
Candidate solution for 3.1: Add to
|
With #360 support was added for
properties
, but I can't find any support foradditonalProperties
(see https://swagger.io/docs/specification/data-models/dictionaries/). AFAICT it looks like the model does support additional properties (see also #100), but I cannot find anything in the@Schema
annotation.The text was updated successfully, but these errors were encountered: