-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add support for extension property of OpenAPI 3_0 #3301
Comments
This makes sense and the approach seems reasonable. If you push a PR for this change, happy to review and merge it. |
AleCamerini
added a commit
to AleCamerini/elide
that referenced
this issue
Nov 25, 2024
Hello, I opened a PR for this issue, please let me know if any other actions on my side are needed @aklish |
Thank you. I’m traveling but will look tomorrow.
Aaron
…On Fri, Nov 29, 2024 at 4:04 AM Alessandro Camerini < ***@***.***> wrote:
Hello, I opened a PR for this issue, please let me know if any other
actions on my side are needed @aklish <https://github.com/aklish>
—
Reply to this email directly, view it on GitHub
<#3301 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVH6QPLOHHKUAVIRFBJSFL2DA3Z7AVCNFSM6AAAAABSCN5ADCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBXGQ3TINZYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
aklish
pushed a commit
that referenced
this issue
Nov 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, OpenAPI swagger documentation supports the definition of extension properties in the @Schema annotation, it is built like a Map<String, Object> and generally allows the OpenAPI user to define customs properties on the documentation.
Expected Behavior
We could use this feature to address which of our attributes is a localized attribute by simply defining this annotation:
Multiple extentionProperties can be defined in the same Schema. allowing us to enhance the OpenAPI doc further.
It could also be useful to define the types of relationships in the OpenAPI documentation with something like this:
the output of the schema above for a normal attribute will be something like this:
Current Behavior
Currently this feature is not supported on Elide meaning that the openAPI doc ignores this property inside the schema annotation
Possible Solution
A possible solution that can be done is to add inside the JsonApiModelResolver.class a method like this:
Then call it inside the processAttribute and processRelationship method by calling the Schema<?>.setExtensions method like this:
Context
The reason I'm opening this feature is that I need to send more information to the FrontEnd point of my applications through OpenAPI to handle various situations, such as localized properties and others. By adding the extension property we are able to send all the necessary information and many more, leading to a more customizable experience for OpenAPI definition.
The text was updated successfully, but these errors were encountered: