Feature Description
I would like to see a way to define example payloads in the @ExampleObject annotation from a file, rather than declaring constants for it.
- What problem does it solve?
For APIs with larger payloads, defining payloads with @ExampleObjects becomes unmanageable because the examples must be defined as constants, resulting in boilerplate code in Java classes.
- How would it improve swagger-core?
It will make it easier to maintain large example payloads without creating constants in Java.
- Is it related to OpenAPI spec support, annotation improvements, integration, etc.?
It would be categorized as annotation improvement.
Use Case
@ExampleObject ( description = "test description", file = "classpath:/main/resources/openapi/test-example.json")
Suggested Solution (optional)
Add a feature in the @ExampleObject annotation to read a value from a file.
Alternatives Considered
Additional Context
Checklist
Feature Description
I would like to see a way to define example payloads in the @ExampleObject annotation from a file, rather than declaring constants for it.
For APIs with larger payloads, defining payloads with @ExampleObjects becomes unmanageable because the examples must be defined as constants, resulting in boilerplate code in Java classes.
It will make it easier to maintain large example payloads without creating constants in Java.
It would be categorized as annotation improvement.
Use Case
@ExampleObject ( description = "test description", file = "classpath:/main/resources/openapi/test-example.json")
Suggested Solution (optional)
Add a feature in the @ExampleObject annotation to read a value from a file.
Alternatives Considered
Additional Context
Checklist