Json Spec files should output spaces instead of tabs
See original GitHub issueSorting
-
I’m submitting a …
- [ X] bug report
- feature request
- support request
-
I confirm that I
- [ X] used the search to make sure that a similar issue hasn’t already been submit
Expected Behavior
Spec files should not have tabs (json files specifically tested). Using ‘npx @stoplight/spectral lint --verbose ./src/swagger/openapi.json’ should NOT return ‘warning parser Using tabs can lead to unpredictable results’
Current Behavior
Using ‘npx @stoplight/spectral lint --verbose ./src/swagger/openapi.json’ returns ‘warning parser Using tabs can lead to unpredictable results’
Possible Solution
on line 42 of the following snippet
let data = JSON.stringify(spec, null, '\t');
replace the ‘/t’ with 2 or 4
Steps to Reproduce
Generate a spec with version 3.5.2
Using npx @stoplight/spectral lint --verbose ./src/swagger/openapi.json
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
How to indent as spaces instead of tab?
I tried shiftwidth=2 , tabstop=2 , but no matter what, it's still indents using tabs instead of spacebar, which causes the JADE compile...
Read more >What is the JSON indentation level convention? - Stack Overflow
Should it be 2 spaces, 3 spaces, 4 spaces, tabs delimited, or something else? I tried to come across the official JSON site,...
Read more >Developers Who Use Spaces Make More Money Than Those ...
The model estimated that using spaces instead of tabs is associated with an 8.6% higher ... Who would choose to have their files...
Read more >Unflatten from JSON does not like tab character (\t, 0x09)
Solved: Getting error -375003 when running the attached VI. The string in the control has a tab character (\t) after the letters "AFE"....
Read more >JSON - Wikipedia
JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am not sure about the JSON spec. But how I discovered this “problem” is following the TSOA docs. In them it mentions using stoplight/spectrum to validate the Open Api file. In doing so it outputs thousands of lines of warnings regarding the tabs. The “rule” cannot be turned off as it considers it a parsing error. Effectively hiding all other warnings.
👍 would like this to be implemented