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

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

Open
Hunga1 opened this issue Aug 1, 2022 · 0 comments
Open

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

Hunga1 opened this issue Aug 1, 2022 · 0 comments

Comments

@Hunga1
Copy link

Hunga1 commented Aug 1, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant