eclipse / microprofile-open-api

Microprofile open api
Apache License 2.0
134 stars 82 forks source link

Allow custom schema to be specified directly in annotation #610

Open Azquelt opened 6 months ago

Azquelt commented 6 months ago

What are your thoughts on having a String value() default "" property that could be used to set an arbitrary schema (that must be valid JSON/YAML)? That would give support for alternate dialects with the annotation.

I'm not sure myself, but I wanted to mention it as a possibility.

_Originally posted by @MikeEdgar in https://github.com/eclipse/microprofile-open-api/pull/601#discussion_r1593060737_

Azquelt commented 6 months ago

Initial thoughts

Azquelt commented 6 months ago

I've provisionally added this to the 4.0 milestone, but we can decide not to do it and close it, or push it out of 4.0 if we're unsure or don't have time.

Azquelt commented 5 months ago

Discussed on the call today, on balance we think it's probably a good idea, it provides access to all of the possible schema options and sidesteps the lack of recursion in Java annotations.

We thought that an exception should probably be thrown at startup if the value is not well-formed JSON.

However, we don't think we have enough time to add it in this release, though as it's just adding a new annotation parameter it would be a good candidate for a future minor release.