swagger-api / swagger-api/swagger-parser

default value for Object schema is not converted correctly

Open
#1,331 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

swagger-parser-v3 version: 2.0.17

When parsing openapi document which has a default value for an object schema, has the default value set as an object of type com.fasterxml.jackson.databind.node.ObjectNode. The value should have been of type Schema. Please use a sample schema and check the value of _default or getDefault for the schema.

   defaultSchema:
      type: object
      properties:
        id: 
          type: integer
          default: 100
        name:
          type: string
          default: Ashii
      default:
        id: 100
        name: Ash

image

Thanks,
Aishvarya

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 by reproducing the issue with swagger-parser-v3 2.0.17 and the sample OpenAPI object schema. Inspect the schema's _default or getDefault value after parsing; done means the object default is represented as a Schema rather than a Jackson ObjectNode.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.