swagger-api / swagger-api/swagger-parser
Automatic $ref management while calling model's methods
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Hi,
Is possible to get an automatic $ref management like this one:
- You have a Schema object that contains a $ref
- You call a method, for example
schema.getName() - Inside the
getName()call, the objects itself checks if it's a ref withget$ref() != null - If it's a ref, It automatically solves and populates itself and the function
getName()returns the name solved
I think It can be achieved in a simple way subclassing the actual models and It should not create problems with circular $ref, because you solve only one "sublevel" for method call
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
Start by locating the Schema model and the existing getName() and get$ref() methods; the issue does not name files or tests. Read how model subclasses and reference resolution currently work, then define completion around method calls resolving one referenced level while preserving the stated circular-$ref behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100