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

Export spec should not contain x-oad-type attributes #350

Open
brylie opened this issue Jan 12, 2018 · 3 comments
Open

Export spec should not contain x-oad-type attributes #350

brylie opened this issue Jan 12, 2018 · 3 comments

Comments

@brylie
Copy link
Contributor

brylie commented Jan 12, 2018

When trying to import a spec file from OpenAPI Designer into the Swagger Editor, there are several validation errors. A common validation error is:

Sibling values are not allowed alongside $refs

This basically means that anywhere there is a $ref element, it cannot have any other elements in the same scope. See, for example:

startTime:
  // The x-oad-type invalidates the schema
  x-oad-type: reference
  $ref: '#/definitions/time'

Task

Make sure exported spec file does not contain x-oad-type attributes. Also, make sure exported spec file is valid - i.e. should not have any validation errors.

@brylie brylie changed the title Sibling values are not allowed alongside $refs Export spec should not contain x-oad-type attributes Jan 22, 2018
@Yuman1
Copy link

Yuman1 commented Sep 26, 2018

Due to lines containing "x-oad-type", the exported spec is incompatible with editor.swagger.io. The following regex operation solves the problem one-way:
replace{\n\s+"x-oad-type": "\w+".*\n}{\n}

The cleaned up spec cannot be imported back to openapi.designer.

@brylie
Copy link
Contributor Author

brylie commented Sep 27, 2018

We had the same problem with Swagger editor, which is why this issue exists. Please consider increasing the priority, so that output from OpenAPI Designer is compatible with Swagger Editor.

@Yuman
Copy link

Yuman commented Oct 7, 2018

A follow-up on a previous post, I have used this fix to bridge between openapi.designer and swagger editor both ways:
replace{,?\n\s+"x-oad-type": "\w+".*\n}{\n}
You can export to JSON, run the fix in a text editor, import to swagger, export from swagger, and import back into openapi.designer. That shows that x-oad-type is unnecessary even within oad. Removing it will make oad much more useful.

@ilarimikkonen ilarimikkonen added this to Medium Priority in apinf/openapi-designer Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
apinf/openapi-designer
Medium Priority
Development

No branches or pull requests

4 participants