-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add custom options to allow more control of swagger/openapi output #145
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6ff06d8
Apply additional Swagger properties using JSON.
ivucica fcc2dca
Swagger: Replaced '<!-- ... -->' for raw JSON with last paragraph 'Sw…
ivucica 20a6d40
Change from 'Swagger: ' to 'OpenAPI: ' prefix.
ivucica 321663d
WIP: Use a proto option to describe whether a Swagger Operation is de…
ivucica 7043966
WIP: Setting API properties through an option.
ivucica cdc1094
WIP: Correctly reserve fields. Update link. TODO: merge with commit M…
ivucica 41b436f
WIP: Refer to the specification as OpenAPI v2, not Swagger.
ivucica 74cd394
WIP: Clean up after OpenAPIv2 options proto generation.
ivucica 549ccee
WIP: JSON is disappearing from the output protos.
ivucica 6b2b321
WIP: Fix typo 'want an Swagger' -> 'want a Swagger object'.
ivucica db4a056
WIP: Process all remaining fields of the OpenAPI v2 Swagger object.
ivucica 7697bcf
WIP: ExternalDocs belongs on OpenAPIv2's Swagger object, not on the I…
ivucica 162c375
WIP: Remove use of JSON. Introduce schema and tag object. Support ext…
ivucica b53579c
WIP: Add built annotations.pb.go and openapiv2.pb.go.
ivucica 60d116f
WIP: go fmt on protoc-gen-swagger.
ivucica d509096
WIP: Provide a more unique operation ID in case of additional bindings.
ivucica 3949620
WIP: Try to fix integration test by removing 'host' from the Swagger …
ivucica a386e97
WIP: Remove swaggerExtrasRegexp.
ivucica 290f777
WIP: Move error checking for extractSchemaOptionFromMessageDescriptor…
ivucica 97ee19b
WIP: Fix typo: 'want a Schema'.
ivucica ceb4c4e
Assign IDs for proto options extensions.
ivucica 099fda5
Move test definitions for options-based extension to Swagger output f…
ivucica d7b0ba4
Undo commenting out dependency on EXAMPLE_CLIENT_SRCS.
ivucica d7a9a69
Change the proto package to start with 'grpc.gateway', as seems to be…
ivucica 84c3046
Add a comment about all IDs being ok to be the same.
ivucica a543b9e
Regenerated Swagger-generated clients.
ivucica File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,18 @@ import "protoc-gen-swagger/options/openapiv2.proto"; | |
import "google/protobuf/descriptor.proto"; | ||
|
||
extend google.protobuf.FileOptions { | ||
// TODO(ivucica): ask [email protected] to assign ID | ||
Swagger openapiv2_swagger = 123456788; | ||
// ID assigned by [email protected] for grpc-gateway project. | ||
Swagger openapiv2_swagger = 1042; | ||
} | ||
extend google.protobuf.MethodOptions { | ||
// TODO(ivucica): ask [email protected] to assign ID | ||
Operation openapiv2_operation = 123456789; | ||
// ID assigned by [email protected] for grpc-gateway project. | ||
Operation openapiv2_operation = 1042; | ||
} | ||
extend google.protobuf.MessageOptions { | ||
// TODO(ivucica): ask [email protected] to assign ID | ||
Schema openapiv2_schema = 123456790; | ||
// ID assigned by [email protected] for grpc-gateway project. | ||
Schema openapiv2_schema = 1042; | ||
} | ||
extend google.protobuf.ServiceOptions { | ||
// TODO(ivucica): ask [email protected] to assign ID | ||
Tag openapiv2_tag = 123456791; | ||
// ID assigned by [email protected] for grpc-gateway project. | ||
Tag openapiv2_tag = 1042; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note on why they are all the same ID and why that is okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.