-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5dd98a1
commit 0bd2b81
Showing
29 changed files
with
736 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,32 +6,35 @@ struct OpenAPIController: RouteCollection { | |
|
||
// MARK: Internal | ||
|
||
func boot(routes: RoutesBuilder) throws { | ||
|
||
// generate OpenAPI documentation | ||
routes.get("swagger", "swagger.json") { req in | ||
req.application.routes.openAPI( | ||
info: InfoObject( | ||
title: "Swagger Petstore - OpenAPI 3.0", | ||
description: "This is a sample Pet Store Server based on the OpenAPI 3.0.1 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)", | ||
termsOfService: URL(string: "http://swagger.io/terms/"), | ||
contact: ContactObject( | ||
email: "[email protected]" | ||
), | ||
license: LicenseObject( | ||
name: "Apache 2.0", | ||
url: URL(string: "http://www.apache.org/licenses/LICENSE-2.0.html") | ||
), | ||
version: Version(1, 0, 17) | ||
), | ||
externalDocs: ExternalDocumentationObject( | ||
description: "Find out more about Swagger", | ||
url: URL(string: "http://swagger.io")! | ||
) | ||
) | ||
} | ||
.excludeFromOpenAPI() | ||
func boot(routes: RoutesBuilder) throws { | ||
|
||
routes.stoplightDocumentation("docs", openAPIPath: "/swagger/swagger.json") | ||
} | ||
// generate OpenAPI documentation | ||
routes.get("swagger", "swagger.json") { req in | ||
req.application.routes.openAPI( | ||
info: InfoObject( | ||
title: "Swagger Petstore - OpenAPI 3.0", | ||
description: "This is a sample Pet Store Server based on the OpenAPI 3.0.1 specification.", | ||
termsOfService: URL(string: "http://swagger.io/terms/"), | ||
contact: ContactObject( | ||
email: "[email protected]" | ||
), | ||
license: LicenseObject( | ||
name: "Apache 2.0", | ||
url: URL(string: "http://www.apache.org/licenses/LICENSE-2.0.html") | ||
), | ||
version: Version(1, 0, 17) | ||
), | ||
externalDocs: ExternalDocumentationObject( | ||
description: "Find out more about Swagger", | ||
url: URL(string: "http://swagger.io")! | ||
) | ||
) | ||
} | ||
.excludeFromOpenAPI() | ||
|
||
routes.stoplightDocumentation( | ||
"stoplight", | ||
openAPIPath: "/swagger/swagger.json" | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.