You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using complex on Spring REST API - type is incorrectly defined on the API schema (type = object instead of $ref) if it implements Map interface
To Reproduce
Steps to reproduce the behavior:
Try to use complex model object as RequestBody with @Schema definitions.
On the API schema we have: "requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","description":"Body","example":{"key":"value"}},"description":"Body","example":{"key":"value"}}}},"required":true}
instead of "requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body"}}},"required":true}
Expected behavior
Type should be properly marked on schema/ui with $ref instead of type=object
Schema model should be available on "Models" section on UI
No need for additional schema definition on RequestBody annotation
P.S.
It there any option to hide interface methods on the API without custom code (check MapExclusion interface and usage on example repository which is used to hide isEmpty() method from the API schema)
The text was updated successfully, but these errors were encountered:
infoShare
changed the title
Inforrect RequestBody type on schema/ui
Inforrect RequestBody type on schema/ui if implements Map interface
Jan 7, 2022
infoShare
changed the title
Inforrect RequestBody type on schema/ui if implements Map interface
Incorrect RequestBody type on schema/ui if class implements Map
Jan 7, 2022
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
To Reproduce
Steps to reproduce the behavior:
"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"object","description":"Body","example":{"key":"value"}},"description":"Body","example":{"key":"value"}}}},"required":true}
instead of
"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body"}}},"required":true}
Expected behavior
Repository with example
https://github.com/infoShare/swagger-requestbody-schema
P.S.
It there any option to hide interface methods on the API without custom code (check MapExclusion interface and usage on example repository which is used to hide isEmpty() method from the API schema)
The text was updated successfully, but these errors were encountered: