forked from nytimes/openapi2proto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nytimes#122 from nytimes/global-responses
Adding the ability to use a global 'responses' object.
- Loading branch information
Showing
5 changed files
with
92 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto3"; | ||
|
||
package example; | ||
|
||
message ExampleOperationRequest { | ||
ExampleRequest body = 1; | ||
} | ||
|
||
message ExampleRequest { | ||
string example = 1; | ||
} | ||
|
||
message ExampleResponse { | ||
string anotherExample = 1; | ||
} | ||
|
||
service ExampleService { | ||
// Example operation | ||
rpc ExampleOperation(ExampleOperationRequest) returns (ExampleResponse) {} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
swagger: "2.0" | ||
|
||
info: | ||
title: example | ||
description: An example API to demonstrate issue in responses | ||
version: 1.0.0 | ||
paths: | ||
/example: | ||
post: | ||
operationId: exampleOperation | ||
description: Example operation | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
$ref: '#/definitions/ExampleRequest' | ||
responses: | ||
200: | ||
$ref: '#/responses/ExampleResponse' | ||
400: | ||
$ref: '#/responses/BadRequest' | ||
definitions: | ||
ExampleRequest: | ||
type: object | ||
required: | ||
- example | ||
properties: | ||
example: | ||
type: string | ||
responses: | ||
ExampleResponse: | ||
description: Example response | ||
schema: | ||
type: object | ||
properties: | ||
anotherExample: | ||
type: string | ||
BadRequest: | ||
description: Bad request |
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