You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: .github/workflows/govulncheck.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ jobs:
29
29
30
30
# ... such as the Code Scanning tab (https://github.com/oapi-codegen/oapi-codegen/security/code-scanning?query=is%3Aopen+branch%3Amain+tool%3Agovulncheck)
Copy file name to clipboardExpand all lines: README.md
+5-26Lines changed: 5 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,8 +50,6 @@ go install github.com/oapi-codegen/oapi-codegen-exp/v2/cmd/oapi-codegen@latest
50
50
51
51
## Install
52
52
53
-
### For Go 1.24+
54
-
55
53
It is recommended to follow [the `go tool` support available from Go 1.24+](https://www.jvt.me/posts/2025/01/27/go-tools-124/) for managing the dependency of `oapi-codegen` alongside your core application.
56
54
57
55
To do this, you run `go get -tool`:
@@ -67,29 +65,6 @@ From there, each invocation of `oapi-codegen` would be used like so:
67
65
//go:generate go tool oapi-codegen -config cfg.yaml ../../api.yaml
68
66
```
69
67
70
-
### Prior to Go 1.24
71
-
72
-
It is recommended to follow [the `tools.go` pattern](https://www.jvt.me/posts/2022/06/15/go-tools-dependency-management/) for managing the dependency of `oapi-codegen` alongside your core application.
Then, each invocation of `oapi-codegen` would be used like so:
88
-
89
-
```go
90
-
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml ../../api.yaml
91
-
```
92
-
93
68
Alternatively, you can install it as a binary with:
94
69
95
70
```sh
@@ -145,11 +120,13 @@ For full details of what is supported, it's worth checking out [the GoDoc for `c
145
120
We also have [a JSON Schema](configuration-schema.json) that can be used by IDEs/editors with the Language Server Protocol (LSP) to perform intelligent suggestions, i.e.:
Note that it's recommended to pin to a specific version of the configuration schema, so it matches the version of `oapi-codegen` you're using. For instance, if you're using [Renovate](https://docs.renovatebot.com/), you can [have Renovate automagically update this version for you](https://www.jvt.me/posts/2026/03/01/oapi-codegen-config-renovate/).
129
+
153
130
### Backwards compatibility
154
131
155
132
Although we strive to retain backwards compatibility - as a project that's using a stable API per SemVer - there are sometimes opportunities we must take to fix a bug that could cause a breaking change for [people relying upon the behaviour](https://xkcd.com/1172/).
@@ -3452,6 +3429,8 @@ It is also possible to use HTTPS URLs.
3452
3429
>
3453
3430
> See [this blog post](https://www.jvt.me/posts/2024/04/27/github-actions-update-file/) for an example of how to use GitHub Actions to manage the updates of files across repos
3454
3431
>
3432
+
> See [this blog post](https://www.jvt.me/posts/2026/02/27/renovate-update-file) for an example of how to use Renovate to manage the updates of files across repos
3433
+
>
3455
3434
> This will be disabled by default (but possible to turn back on via configuration) [in the future](https://github.com/oapi-codegen/oapi-codegen/issues/1564)
3456
3435
3457
3436
To use it, you can use the following configuration:
Copy file name to clipboardExpand all lines: configuration-schema.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -255,7 +255,7 @@
255
255
},
256
256
"resolve-type-name-collisions": {
257
257
"type": "boolean",
258
-
"description": "When set to true, automatically renames types that collide across different OpenAPI component sections (schemas, parameters, requestBodies, responses, headers) by appending a suffix based on the component section (e.g., 'Parameter', 'Response', 'RequestBody'). Without this, the codegen will error on duplicate type names, requiring manual resolution via x-go-name.",
258
+
"description": "When set to true, automatically renames types that collide across different OpenAPI component sections (schemas, parameters, requestBodies, responses, headers) by appending a suffix based on the component section. Also detects collisions between component types and client response wrapper types. Without this, the codegen will error on duplicate type names, requiring manual resolution via x-go-name.",
0 commit comments