1.install
# npm install -g @stoplight/spectral-cli
2.設定
# echo '{\n\t"extends": ["spectral:oas"]\n}' > .spectral.json
3.version
# spectral --version 6.5.0 #
4.lint 実行
# spectral lint openapi.yml No results with a severity of 'error' found!#
5.上の結果
Excuteのbuttonが押せない理由が表示されない
# spectral lint openapi.yml -F warn No results with a severity of 'warn' or higher found!# # spectral lint openapi.yml -F error No results with a severity of 'error' found!# # spectral lint openapi.yml -F info No results with a severity of 'info' or higher found!# # spectral lint openapi.yml -F hint No results with a severity of 'hint' or higher found!#
6. 代わりに、Swagger/OpenAPI online validatorを使う
https://apitools.dev/swagger-parser/online/
– After pasting, just press the [Validate it!].
– result
bad indentation of a mapping entry at line 173, column 16: name: contactType ^ Error: bad indentation of a mapping entry at line 173, column 16: name: contactType ^
– Excuteのbuttonが押せない原因の行を指示