swagger-api / swagger-api/swagger-parser
3.1.0 spec parsing, $defs information omitted
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
3.1.0 spec parsing, $defs information omitted
When parsing a spec like this:
# OAS document that uses 3.1 features:
# 'null' type
# type array
openapi: 3.1.0
info:
version: 1.0.0
title: Example
license:
name: MIT
identifier: MIT
servers:
- url: http://api.example.xyz/v1
paths:
/somePath:
get:
operationId: getSomePath
responses:
'200':
description: OK
content:
application/json:
schema: {}
components:
schemas:
AnyTypeWithDefs:
properties:
firstName:
$ref: "#/components/schemas/AnyTypeWithDefs/$defs/name"
lastName:
$ref: "#/components/schemas/AnyTypeWithDefs/$defs/name"
$defs:
name:
type: string
ObjectWithDefs:
properties:
firstName:
$ref: "#/components/schemas/ObjectWithDefs/$defs/name"
lastName:
$ref: "#/components/schemas/ObjectWithDefs/$defs/name"
$defs:
name:
type: string
- the java Schema object lacks any acessor getters/properties to get the defs info
- this info is not surfaced by the parser's output
This prevents downstream users of this library from being able to implement the openapi 3.1.0 and 2020-12 json schema $defs feature
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 with the Java Schema object and the parser output described in the issue. Parse the supplied OpenAPI 3.1 document and trace how the $defs entries are represented or omitted. Done means downstream users can access the parsed $defs information, with coverage showing both schemas retain their nested name definition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100