forked from deepmap/oapi-codegen
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add client-type-prefix output option (deepmap#785)
- Loading branch information
1 parent
63fe9cc
commit 3262572
Showing
7 changed files
with
292 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
openapi: "3.0.0" | ||
info: | ||
version: 1.0.0 | ||
title: Prefixed Client Example | ||
paths: | ||
/client: | ||
get: | ||
operationId: getClient | ||
responses: | ||
200: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Client" | ||
components: | ||
schemas: | ||
Client: | ||
type: object | ||
required: | ||
- name | ||
properties: | ||
name: | ||
type: string |
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,7 @@ | ||
package: prefixedclient | ||
output: prefixed-client.gen.go | ||
generate: | ||
models: true | ||
client: true | ||
output-options: | ||
client-type-prefix: Prefixed |
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,6 @@ | ||
package prefixedclient | ||
|
||
// This is an example of how to add a prefix to the name of the generated Client struct | ||
// See https://github.com/deepmap/oapi-codegen/issues/785 for why this might be necessary | ||
|
||
//go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen -config cfg.yaml api.yaml |
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
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