Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.
This repository was archived by the owner on Sep 13, 2023. It is now read-only.

Fails to parse path names starting with a question mark #30

Description

@Hunga1

I'm trying to parse an OpenAPI specification written in YAML that contains a path name that starts with a question mark, but the openapi.Parse function is returning the following error:

2022/07/31 22:47:56 [7:5] unexpected key name
       4 |   version: 1.0.0
       5 | openapi: 3.0.1
       6 | paths:? /images/meta/{ImageID}.json
               ^
       8 |   : description: Fetch a static image metadata
       9 |     get:
      10 |       description: Fetch static image metadata
      11 |       
exit status 1

Here is the OpenAPI specification that I'm using to produce the error:

info:
  description: Example API
  title: Example API
  version: 1.0.0
openapi: 3.0.1
paths:
  ? /images/meta/{ImageID}.json
  : description: Fetch a static image metadata
    get:
      description: Fetch static image metadata
      operationId: FetchImageMetadata
      parameters:
      - description: ID of the image
        in: path
        name: ImageID
        required: true
        schema:
          maxLength: 36
          minLength: 36
          type: string
          pattern: ^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$
      responses:
        '200':
          description: OK

The YAML seems to be valid syntax and is OpenAPI spec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions