swagger-api / swagger-api/swagger-core

CustomResolver's Results get overwritten by default ModelResolver

Open
#4,905 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.