Skip to content

Commit f459fd7

Browse files
committed
docs: note that JSON Schema should be pinned
Plus add Renovate configuration to update this in the future.
1 parent 863c6ea commit f459fd7

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ For full details of what is supported, it's worth checking out [the GoDoc for `c
112112
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.:
113113

114114
```yaml
115-
# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json
115+
# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/v2.6.0/configuration-schema.json
116116
package: api
117117
# ...
118118
```
119119

120+
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/).
121+
120122
### Backwards compatibility
121123

122124
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/).

renovate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,18 @@
6969
"executionMode": "branch"
7070
}
7171
}
72+
],
73+
"customManagers": [
74+
{
75+
"customType": "regex",
76+
"managerFilePatterns": [
77+
"README.md"
78+
],
79+
"matchStrings": [
80+
"# yaml-language-server: \\$schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/(?<currentValue>[^/]+)/configuration-schema.json"
81+
],
82+
"depNameTemplate": "github.com/oapi-codegen/oapi-codegen/v2",
83+
"datasourceTemplate": "go"
84+
}
7285
]
7386
}

0 commit comments

Comments
 (0)