Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to generate OpenAPI from API Blueprint #73

Closed
doobnet opened this issue Oct 12, 2023 · 2 comments
Closed

Fails to generate OpenAPI from API Blueprint #73

doobnet opened this issue Oct 12, 2023 · 2 comments

Comments

@doobnet
Copy link

doobnet commented Oct 12, 2023

I'm trying to convert an API Blueprint document to OpenAPI but it fails with the following error: Type "extend" is not a valid type.

Here's a minmal test case of an API Blueprint document that fails:

FORMAT: 1A
HOST: http://127.0.0.1/api/v1

# Group Extensions

## Extensions [/extensions]

### Get extensions [GET]

+ Response 200 (application/json)
    + Attributes (Extension)

## Data Structures

### Extension (enum)

+ (Foo type)

### Foo type (object, fixed-type)

+ id (string) - the id

I used the following command to run the tool:

apib2swagger -i example.md --open-api-3 -o openapi.json

The full output of running the above command is:

Error
    at Object.<anonymous> (apib2swagger/node_modules/json-schema-to-openapi-schema/index.js:8:30)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Module.load (node:internal/modules/cjs/loader:1113:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1137:19)
    at require (node:internal/modules/helpers:121:18)
    at Object.<anonymous> (apib2swagger/src/requests.js:4:19)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10) {
  name: 'InvalidTypeError',
  message: 'Type "extend" is not a valid type'
}
@kminami
Copy link
Owner

kminami commented Oct 22, 2023

Thank you for reporting!
I have fixed bugs around enum of MSON at v1.17.1.
Please confirm the result.

@doobnet
Copy link
Author

doobnet commented Oct 22, 2023

Yes, it's working. Thanks.

@doobnet doobnet closed this as completed Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants