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

Add support for YAML format of OpenAPI specification #27

Open
ChristopherL-STCU opened this issue Aug 16, 2021 · 3 comments
Open

Add support for YAML format of OpenAPI specification #27

ChristopherL-STCU opened this issue Aug 16, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ChristopherL-STCU
Copy link

When I add a YAML file to the api-specs folder and then run npm run publish it results in an error.

Sample OpenAPI file:

openapi: 3.0.0
info:
  title: Simple test
  version: '1.0'
paths:
  /test:
    get:
      responses:
        '204':
          description: No response

Error:

Error: Unable to complete publishing. Error: Unable to complete OpenAPI specifications publishing. SyntaxError: Unexpected token o in JSON at position 0
at JSON.parse ()
at OpenApiPublisher.eval (webpack://publisher/./src/publishing/openApiPublisher.ts?:29:46)
at Generator.next ()
at fulfilled (webpack://publisher/./src/publishing/openApiPublisher.ts?:5:58)
at OpenApiPublisher.eval (webpack://publisher/./src/publishing/openApiPublisher.ts?:39:23)
at Generator.next ()
at fulfilled (webpack://publisher/./src/publishing/openApiPublisher.ts?:5:58)
at SitePublisher.eval (webpack://publisher/./node_modules/@paperbits/core/publishing/sitePublisher.ts?:40:23)
at Generator.throw ()
at rejected (webpack://publisher/./node_modules/@paperbits/core/publishing/sitePublisher.ts?:6:65)

It seems to be trying to parse the YAML file as JSON.

@azaslonov
Copy link
Member

Hi @ChristopherL-STCU, why would you add YAML file to specs folder? Can you please tell what are you trying to achieve?

@azaslonov azaslonov self-assigned this Aug 31, 2021
@azaslonov azaslonov added the question Further information is requested label Aug 31, 2021
@azaslonov
Copy link
Member

azaslonov commented Aug 31, 2021

Sorry, I didn't realize you're talking about YAML format of spec. This format is not supported yet.

@azaslonov azaslonov changed the title Adding basic YAML file results in build error Add support for YAML format of OpenAPI specification Aug 31, 2021
@azaslonov azaslonov added enhancement New feature or request and removed question Further information is requested labels Aug 31, 2021
@ChristopherL-STCU
Copy link
Author

Yes, that's it. Okay, thank you.

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

No branches or pull requests

2 participants