-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protoc-gen-swagger: add example similar to AIP-133
This example illustrates that the `book_id` field is not converted into a query string parameter in the generated swagger.json file.
- Loading branch information
1 parent
ed01939
commit 9b3a0d5
Showing
9 changed files
with
916 additions
and
233 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
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,24 @@ | ||
/* | ||
* A Bit of Everything | ||
* | ||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) | ||
* | ||
* API version: 1.0 | ||
* Contact: [email protected] | ||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) | ||
*/ | ||
|
||
package abe | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
type ExamplepbBook struct { | ||
// The resource name of the book. Format: `publishers/{publisher}/books/{book}` Example: `publishers/1257894000000000000/books/my-book` | ||
Name string `json:"name,omitempty"` | ||
// Output only. The book's ID. | ||
Id string `json:"id,omitempty"` | ||
// Output only. Creation time of the book. | ||
CreateTime time.Time `json:"create_time,omitempty"` | ||
} |
24 changes: 24 additions & 0 deletions
24
examples/internal/clients/abe/model_examplepb_collection.go
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,24 @@ | ||
/* | ||
* A Bit of Everything | ||
* | ||
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) | ||
* | ||
* API version: 1.0 | ||
* Contact: [email protected] | ||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) | ||
*/ | ||
|
||
package abe | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
type ExamplepbCollection struct { | ||
// The resource name of the collection. Format: `accounts/{account}/collections/{collection}` Example: `accounts/1257894000000000000/collections/my-collection` | ||
Name string `json:"name,omitempty"` | ||
// Output only. The collection's ID. | ||
Id string `json:"id,omitempty"` | ||
// Output only. Creation time of the collection. | ||
CreateTime time.Time `json:"create_time,omitempty"` | ||
} |
Oops, something went wrong.