swagger-api / swagger-api/swagger-parser

Parse report error message bug

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

I try to parse the following spec yaml:

openapi: 3.0.2
info:
  version: v1
  title: abc
paths:
  /queryCommon:
    post:
      operationId: query
      responses:
        "405":
          description: Invalid input
components:
  schemas:
    Body:
      type: object
      properties:
        orgid:
          tilte: 'foo'   # this is a typo
          type: integer
          format: int32

Notice that components.schemas.Body.properties.orgid.tilte is a typo. Then got a an error message:

attribute components.schemas.Body.tilte is unexpected

Which is not accurate

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 report with the YAML example and inspect how the validation error path is assembled for components.schemas.Body.properties.orgid.tilte. Trace the parser's handling of nested schema properties and verify that the reported path includes properties.orgid; done means the error identifies the misspelled field at its actual location.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.