Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 28 additions & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"release": "npx np --branch main"
},
"dependencies": {
"@stoplight/yaml": "^4.3.0",
"yaml": "^2.8.3",
"api-ref-bundler": "^0.5.0",
"case-anything": "2.1.10",
"jsonpathly": "^3.0.0",
Expand Down Expand Up @@ -76,4 +76,4 @@
"directories": {
"test": "test"
}
}
}
14 changes: 1 addition & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -1699,18 +1699,6 @@ For handling AsyncAPI documents, we have created a separate
package [asyncapi-format](https://github.com/thim81/asyncapi-format) to allow customisation specific for AsyncAPI
use-cases.

## Stoplight Studio

We have adopted the YAML parsing style from [Stoplight Studio](https://stoplight.io/studio/), by leveraging
the [@stoplight/yaml](https://www.npmjs.com/package/@stoplight/yaml) package for handling the parsing of OpenAPI YAML
files.

By using the Stoplight YAML parsing, the results will be slightly different from when using a normal YAML parsing
library, like [js-to-yaml](https://www.npmjs.com/package/js-yaml). We appreciate the Stoplight Studio tool, since it is
an excellent GUI for working with OpenAPI documents for non-OpenAPI experts who will be contributing changes. By
adopting the Stoplight Studio YAML parsing, the potential risk of merge conflicts will be lowered, which is the main
reason why we opted for using the @stoplight/yaml package.

## Credits

This package is inspired by
Expand All @@ -1727,4 +1715,4 @@ The casing options available in `openapi-format` are powered by the excellent [c
<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.png" alt="JetBrains logo." width="200px">
</a>

Special thanks to [JetBrains](https://www.jetbrains.com/) for their continuous sponsorship of this project over the last 3 years, and for their support to open-source software (OSS) initiatives.
Special thanks to [JetBrains](https://www.jetbrains.com/) for their continuous sponsorship of this project over the last 3 years, and for their support to open-source software (OSS) initiatives.
8 changes: 4 additions & 4 deletions test/_split/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ info:
version: 1.0.0
description: A compact version of the Train Travel API
paths:
'/stations/{station_id}':
$ref: 'paths/stations_{station_id}.yaml'
/stations/{station_id}:
$ref: paths/stations_{station_id}.yaml
components:
schemas:
Station:
$ref: "components/schemas/Station.yaml"
$ref: components/schemas/Station.yaml
parameters:
StationId:
$ref: "components/parameters/StationId.yaml"
$ref: components/parameters/StationId.yaml
4 changes: 2 additions & 2 deletions test/_split/snap_station.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ get:
summary: Get station information
operationId: getStation
parameters:
- $ref: "../components/parameters/StationId.yaml"
- $ref: ../components/parameters/StationId.yaml
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: "../components/schemas/Station.yaml"
$ref: ../components/schemas/Station.yaml
'404':
description: Station not found
26 changes: 13 additions & 13 deletions test/json-custom-yaml/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ info:
- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
version: 1.0.6-SNAPSHOT
title: Swagger Petstore - OpenAPI 3.0
termsOfService: 'http://swagger.io/terms/'
termsOfService: http://swagger.io/terms/
contact:
email: apiteam@swagger.io
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: /v3
paths:
Expand Down Expand Up @@ -52,8 +52,8 @@ paths:
description: Invalid input
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
- write:pets
- read:pets
tags:
- pet
put:
Expand Down Expand Up @@ -91,8 +91,8 @@ paths:
description: Validation exception
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
- write:pets
- read:pets
tags:
- pet
/pet/findByStatus:
Expand Down Expand Up @@ -131,8 +131,8 @@ paths:
description: Multiple status values can be provided with comma separated strings
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
- write:pets
- read:pets
tags:
- pet
components:
Expand Down Expand Up @@ -337,10 +337,10 @@ components:
type: oauth2
flows:
implicit:
authorizationUrl: 'https://petstore.swagger.io/oauth/authorize'
authorizationUrl: https://petstore.swagger.io/oauth/authorize
scopes:
'write:pets': modify pets in your account
'read:pets': read your pets
write:pets: modify pets in your account
read:pets: read your pets
api_key:
type: apiKey
name: api_key
Expand All @@ -350,7 +350,7 @@ tags:
description: Everything about your Pets
externalDocs:
description: Find out more
url: 'http://swagger.io'
url: http://swagger.io
externalDocs:
description: Find out more about Swagger
url: 'http://swagger.io'
url: http://swagger.io
Loading
Loading