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

Improved support for JSON syntax incl. tab-indented JSON files #489

Open
elicoten opened this issue Apr 4, 2019 · 5 comments
Open

Improved support for JSON syntax incl. tab-indented JSON files #489

elicoten opened this issue Apr 4, 2019 · 5 comments

Comments

@elicoten
Copy link

elicoten commented Apr 4, 2019

Please could I request that the Swagger editor support Swagger files intended with tabs rather than spaces?

We have some existing Swagger files that are indented with tabs and it would be good to be able to open them and use them as-is in the editor.

Thanks!

@tedepstein
Copy link
Collaborator

@elicoten, this is a restriction of the YAML syntax itself, which specifically says that leading tabs are not recognized as indents. So whatever editor or generator produced your existing Swagger documents was not producing legal YAML.

Fortunately it's easy to fix this using a find and replace with regular expressions:

image

You can choose any number of space characters, as long as the indents are consistent within a sibling group.

@elicoten
Copy link
Author

elicoten commented Apr 5, 2019

Thanks for your detailed and helpful reply.

However I was using JSON syntax rather than YAML syntax. I thought that that whitespaces and tabs are both meaningless to JSON syntax and therefore either should technically be acceptable?

Is there a way to change so that instead of attempting to interpret as YAML, it treats the document as JSON?

Thanks again

@tedepstein
Copy link
Collaborator

@elicoten , the following support article is written for our commercial product, RepreZen API Studio. But most or all of the information and tips in that document are relevant to KaiZen OpenAPI Editor:

Working with Swagger-OpenAPI in JSON Format

If you are planning to maintain your OpenAPI v2 or v3 document in KaiZen Editor, we recommend reformatting it to YAML format as described in the support article. KaiZen, like most OpenAPI editors, works much better with YAML format.

@elicoten
Copy link
Author

elicoten commented Apr 5, 2019

Ok, thanks for clarifying that, that does answer the question - at least insofar as what the editor currently supports.

In that case this issue should perhaps be renamed to include "JSON syntax" in the title, and is more a question about whether you would consider adding JSON syntax support more generally.

It sounds like you might not feel that's worthwhile in which case at least having this as a record may help someone else like me who was searching your github issues for information about indentation with tabs.

@elicoten elicoten changed the title Support tab-indented files Improved support for JSON syntax incl. tab-indented JSON files Apr 5, 2019
@tedepstein
Copy link
Collaborator

@elicoten , please feel free to change the name and we can leave this issue open. We don't have plans to support full editing with JSON syntax at this time.

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