-
-
Notifications
You must be signed in to change notification settings - Fork 534
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
- 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
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)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working