swagger-api / swagger-api/swagger-core
CustomResolver's Results get overwritten by default ModelResolver
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 7.5k
- Forks
- 2.3k
- Avg merge
- 18h 1m
- Merged PRs (30d)
- 10
Description
I am experiencing an issue while trying to add a Custom ModelResolver to the Model Resolving Process. As described in https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Extensions#extending-core-resolver I extend the ModelResolver Class and override the "resolveDescription" Method to create a custom Description for some Schema's.
Problem:
When adding a Custom Resolver that returns a custom description (Originial Description in the Annotation + Custom Part) for some Schema's. The Custom Description is Overwritten because of reResolving in the default ModelResolver (See https://github.com/swagger-api/swagger-core/blob/852ed24f50f7b5f3cf9d162346362cdff25acc1f/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L828 )
Is this intended? Is there a way to Customize Description Resolving ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java around line 828 and the resolveDescription override described in the issue. Reproduce the custom resolver registration and compare its description with the default ModelResolver's later resolution. Done means establishing whether the overwrite is intended and, if a change is required, preserving custom descriptions or documenting the supported customization path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100