swagger-api / swagger-api/swagger-parser

Name of schemas in OpenAPI 3 object model

Open
#771 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

The question is here about the Java POJOs provided by this library:

io.swagger.parser.v3
swagger-parser
2.0.0

I am using the OpenAPI 3 model.

Most of the elements -- in this case Shemas -- are listed in maps where the key is their name and the value the object describing it.

This object, as we can see here in the Schema class, has a Name property that is not serialised (logically) but seems to be there as a convenience to make the object self-contained when manipulated from Java.

This field is always null.

My question is: how to make the Swagger/OpenAPI parser populate this field when it is deserialising from a YAML or JSON file?

That would allow us to avoid passing down tuples of Name+Object all around.

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

Start with the linked Schema class and trace how the OpenAPI 3 parser deserializes schema maps from YAML or JSON. Determine whether the map key can populate the Schema name field, and define completion as the field containing each schema's key after parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.