diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56182260fa..3674b1cf16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ This may get converted into a feature request if we don't deem it a bug, but a m ### Asking a question -We'd prefer that questions about "how do I use (this feature)?" or "what do the community think about ...?" get asked using [GitHub Discussions](https://github.com/deepmap/oapi-codegen/discussions) which allow the community to answer them more easily. +We'd prefer that questions about "how do I use (this feature)?" or "what do the community think about ...?" get asked using [GitHub Discussions](https://github.com/oapi-codegen/oapi-codegen/discussions) which allow the community to answer them more easily. ### Making changes that tweak generated code diff --git a/README.md b/README.md index a5ab62bcdd..434592b4e1 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Which then means you can invoke it like so: ### Pinning to commits -While the project does not ([yet](https://github.com/deepmap/oapi-codegen/issues/1519)) have a defined release cadence, there may be cases where you want to pull in yet-unreleased changes to your codebase. +While the project does not ([yet](https://github.com/oapi-codegen/oapi-codegen/issues/1519)) have a defined release cadence, there may be cases where you want to pull in yet-unreleased changes to your codebase. Therefore, you may want to pin your dependency on `oapi-codegen` to a given commit hash, rather than a tag. @@ -91,7 +91,7 @@ To do so, you can run: ```sh # pin to the latest version on the default branch $ go get github.com/oapi-codegen/oapi-codegen/v2@main -# alternatively, to a commit hash i.e. https://github.com/deepmap/oapi-codegen/commit/71e916c59688a6379b5774dfe5904ec222b9a537 +# alternatively, to a commit hash i.e. https://github.com/oapi-codegen/oapi-codegen/commit/71e916c59688a6379b5774dfe5904ec222b9a537 $ go get github.com/oapi-codegen/oapi-codegen/v2@71e916c59688a6379b5774dfe5904ec222b9a537 ``` @@ -372,7 +372,7 @@ We can see that this provides the best means to focus on the implementation of t - Single-file output - Support multiple OpenAPI files by having a package-per-OpenAPI file - Support of OpenAPI 3.0 - - OpenAPI 3.1 support is [awaiting upstream support](https://github.com/deepmap/oapi-codegen/issues/373) + - OpenAPI 3.1 support is [awaiting upstream support](https://github.com/oapi-codegen/oapi-codegen/issues/373) - Note that this does not include OpenAPI 2.0 (aka Swagger) - Extract parameters from requests, to reduce work required by your implementation - Implicit `additionalProperties` are ignored by default ([more details](#additional-properties-additionalproperties)) @@ -1502,7 +1502,7 @@ You can see a little more detail of the generated code in the ["What does it loo > To configure the strict server generation, you must specify another server to be generated. For instance: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json package: api generate: # NOTE another server must be added! @@ -1577,7 +1577,7 @@ components: And a `cfg.yaml`: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json package: client output: client.gen.go generate: @@ -1744,7 +1744,7 @@ paths: content: application/json: # NOTE that this anonymous object is /not/ generated because it's an anonymous, but would be generated if using `generate: client` - # See https://github.com/deepmap/oapi-codegen/issues/1512 + # See https://github.com/oapi-codegen/oapi-codegen/issues/1512 schema: type: object properties: @@ -1777,7 +1777,7 @@ components: And a `cfg.yaml`: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json package: onlymodels output: only-models.gen.go generate: @@ -1806,7 +1806,7 @@ type Client struct { If you wish to also generate the `Unreferenced` type, you would need the following `cfg.yaml`: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json package: onlymodels output: only-models.gen.go generate: @@ -1895,7 +1895,7 @@ components: And finally we have our configuration file: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json # admin/cfg.yaml package: admin output: server.gen.go @@ -1917,7 +1917,7 @@ error generating code: error creating operation definitions: error generating re This is because `oapi-codegen` requires: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json package: admin output: server.gen.go generate: @@ -2029,7 +2029,7 @@ actions: And our configuration file for `oapi-codegen`: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json package: api output: ping.gen.go generate: @@ -2077,7 +2077,7 @@ However, you lose the ability to understand the three cases, as there's no way t - is this field `null`? (Can be checked with `S.Field == nil`) - does this field have a value? (`S.Field != nil && *S.Field == "123"`) -As of `oapi-codegen` [v2.1.0](https://github.com/deepmap/oapi-codegen/releases/tag/v2.1.0) it is now possible to represent this with the `nullable.Nullable` type from [our new library, oapi-codegen/nullable](https://github.com/oapi-codegen/nullable). +As of `oapi-codegen` [v2.1.0](https://github.com/oapi-codegen/oapi-codegen/releases/tag/v2.1.0) it is now possible to represent this with the `nullable.Nullable` type from [our new library, oapi-codegen/nullable](https://github.com/oapi-codegen/nullable). If you configure your generator's Output Options to opt-in to this behaviour, as so: @@ -3021,7 +3021,7 @@ Middleware library > [!NOTE] -> It is [not currently possible](https://github.com/deepmap/oapi-codegen/issues/1038) to validate the HTTP response with a middleware. +> It is [not currently possible](https://github.com/oapi-codegen/oapi-codegen/issues/1038) to validate the HTTP response with a middleware. > [!NOTE] > We're also [exploring](https://github.com/oapi-codegen/exp/issues/1) the use of [libopenapi-validator](https://github.com/pb33f/libopenapi-validator/) for request/response validation middleware @@ -3037,7 +3037,7 @@ If you're using a specification with [Security Schemes](https://spec.openapis.or > > To perform authentication, you will need to use the [validation middleware](#request-response-validation-middleware). > -> In the future, we plan to [implement server-side validation in the generated code](https://github.com/deepmap/oapi-codegen/issues/1524) +> In the future, we plan to [implement server-side validation in the generated code](https://github.com/oapi-codegen/oapi-codegen/issues/1524) To see how this can work, check out the [authenticated API example](examples/authenticated-api/echo). @@ -3091,7 +3091,7 @@ You can specify, through your configuration file, the `output-options.user-templ Within your configuration file, you can specify relative or absolute paths to a file to reference for the template, such as: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json # ... output-options: user-templates: @@ -3112,23 +3112,23 @@ It is also possible to use HTTPS URLs. > > 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 > -> This will be disabled by default (but possible to turn back on via configuration) [in the future](https://github.com/deepmap/oapi-codegen/issues/1564) +> 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) To use it, you can use the following configuration: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json # ... output-options: user-templates: # The following are referencing a version of the default client-with-responses.tmpl file, but loaded in through GitHub's raw.githubusercontent.com. The general form to use raw.githubusercontent.com is as follows https://raw.githubusercontent.com////path/to/template/template.tmpl # Alternatively using raw.githubusercontent.com with a hash - client-with-responses.tmpl: https://raw.githubusercontent.com/deepmap/oapi-codegen/ad5eada4f3ccc28a88477cef62ea21c17fc8aa01/pkg/codegen/templates/client-with-responses.tmpl + client-with-responses.tmpl: https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/ad5eada4f3ccc28a88477cef62ea21c17fc8aa01/pkg/codegen/templates/client-with-responses.tmpl # Alternatively using raw.githubusercontent.com with a tag - client-with-responses.tmpl: https://raw.githubusercontent.com/deepmap/oapi-codegen/v2.1.0/pkg/codegen/templates/client-with-responses.tmpl + client-with-responses.tmpl: https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/v2.1.0/pkg/codegen/templates/client-with-responses.tmpl # Alternatively using raw.githubusercontent.com with a branch - client-with-responses.tmpl: https://raw.githubusercontent.com/deepmap/oapi-codegen/master/pkg/codegen/templates/client-with-responses.tmpl + client-with-responses.tmpl: https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/master/pkg/codegen/templates/client-with-responses.tmpl ``` > [!WARNING] @@ -3139,7 +3139,7 @@ output-options: It's also possible to set the templates inline in the configuration file: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json # ... output-options: user-templates: @@ -3157,7 +3157,7 @@ output-options: ### Using the Go package -Alternatively, you are able to use the underlying code generation as a package, which [will be documented in the future](https://github.com/deepmap/oapi-codegen/issues/1487). +Alternatively, you are able to use the underlying code generation as a package, which [will be documented in the future](https://github.com/oapi-codegen/oapi-codegen/issues/1487). ## Additional Properties (`additionalProperties`) @@ -3166,7 +3166,7 @@ Alternatively, you are able to use the underlying code generation as a package, For simplicity, and to remove a fair bit of duplication and boilerplate, `oapi-codegen` decides to ignore the implicit `additionalProperties: true`, and instead requires you to specify the `additionalProperties` key to generate the boilerplate. > [!NOTE] -> In the future [this will be possible](https://github.com/deepmap/oapi-codegen/issues/1514) to disable this functionality, and honour the implicit `additionalProperties: true` +> In the future [this will be possible](https://github.com/oapi-codegen/oapi-codegen/issues/1514) to disable this functionality, and honour the implicit `additionalProperties: true` Below you can see some examples of how `additionalProperties` affects the generated code. @@ -3789,7 +3789,7 @@ components: - id # allOf performs a union of all types defined, but if there's a duplicate field defined, it'll be overwritten by the last schema - # https://github.com/deepmap/oapi-codegen/issues/1569 + # https://github.com/oapi-codegen/oapi-codegen/issues/1569 IdentityWithDuplicateField: allOf: # `issuer` will be ignored @@ -4024,7 +4024,7 @@ By default, `oapi-codegen` will generate everything from the specification. If you'd like to reduce what's generated, you can use one of a few options in [the configuration file](#usage) to tune the generation of the resulting output: ```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/deepmap/oapi-codegen/HEAD/configuration-schema.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json output-options: include-tags: [] exclude-tags: [] @@ -4061,9 +4061,9 @@ We'll be aware of the issue, and will work to update both the core `oapi-codegen ## Sponsors -For the most part, `oapi-codegen` is maintained in two busy peoples' free time. As noted in [Creating a more sustainable model for `oapi-codegen` in the future](https://github.com/deepmap/oapi-codegen/discussions/1606), we're looking to make this a more sustainable project in the future. +For the most part, `oapi-codegen` is maintained in two busy peoples' free time. As noted in [Creating a more sustainable model for `oapi-codegen` in the future](https://github.com/oapi-codegen/oapi-codegen/discussions/1606), we're looking to make this a more sustainable project in the future. -We're very appreciative of [the many contributors over the years](https://github.com/deepmap/oapi-codegen/graphs/contributors) and the ongoing use of the project 💜 +We're very appreciative of [the many contributors over the years](https://github.com/oapi-codegen/oapi-codegen/graphs/contributors) and the ongoing use of the project 💜 Please consider sponsoring us through GitHub Sponsors either [on the organisation](https://github.com/sponsors/oapi-codegen/) or [directly for Jamie](https://github.com/sponsors/jamietanna/), which helps work towards us being able to maintain the project long term. diff --git a/cmd/oapi-codegen/oapi-codegen.go b/cmd/oapi-codegen/oapi-codegen.go index 1d166f8ba6..2d05cff92c 100644 --- a/cmd/oapi-codegen/oapi-codegen.go +++ b/cmd/oapi-codegen/oapi-codegen.go @@ -297,7 +297,7 @@ func main() { } if strings.HasPrefix(swagger.OpenAPI, "3.1.") { - fmt.Println("WARNING: You are using an OpenAPI 3.1.x specification, which is not yet supported by oapi-codegen (https://github.com/deepmap/oapi-codegen/issues/373) and so some functionality may not be available. Until oapi-codegen supports OpenAPI 3.1, it is recommended to downgrade your spec to 3.0.x") + fmt.Println("WARNING: You are using an OpenAPI 3.1.x specification, which is not yet supported by oapi-codegen (https://github.com/oapi-codegen/oapi-codegen/issues/373) and so some functionality may not be available. Until oapi-codegen supports OpenAPI 3.1, it is recommended to downgrade your spec to 3.0.x") } if len(noVCSVersionOverride) > 0 { diff --git a/configuration-schema.json b/configuration-schema.json index 6344cba2b8..e4bbfe1bc3 100644 --- a/configuration-schema.json +++ b/configuration-schema.json @@ -66,15 +66,15 @@ "properties": { "old-merge-schemas": { "type": "boolean", - "description": "In the past, we merged schemas for `allOf` by inlining each schema within the schema list. This approach, though, is incorrect because `allOf` merges at the schema definition level, not at the resulting model level. So, new behavior merges OpenAPI specs but generates different code than we have in the past. Set OldMergeSchemas to true for the old behavior. Please see https://github.com/deepmap/oapi-codegen/issues/531" + "description": "In the past, we merged schemas for `allOf` by inlining each schema within the schema list. This approach, though, is incorrect because `allOf` merges at the schema definition level, not at the resulting model level. So, new behavior merges OpenAPI specs but generates different code than we have in the past. Set OldMergeSchemas to true for the old behavior. Please see https://github.com/oapi-codegen/oapi-codegen/issues/531" }, "old-enum-conflicts": { "type": "boolean", - "description": "Enum values can generate conflicting typenames, so we've updated the code for enum generation to avoid these conflicts, but it will result in some enum types being renamed in existing code. Set OldEnumConflicts to true to revert to old behavior. Please see: Please see https://github.com/deepmap/oapi-codegen/issues/549" + "description": "Enum values can generate conflicting typenames, so we've updated the code for enum generation to avoid these conflicts, but it will result in some enum types being renamed in existing code. Set OldEnumConflicts to true to revert to old behavior. Please see: Please see https://github.com/oapi-codegen/oapi-codegen/issues/549" }, "old-aliasing": { "type": "boolean", - "description": "It was a mistake to generate a go type definition for every $ref in the OpenAPI schema. New behavior uses type aliases where possible, but this can generate code which breaks existing builds. Set OldAliasing to true for old behavior. Please see https://github.com/deepmap/oapi-codegen/issues/549" + "description": "It was a mistake to generate a go type definition for every $ref in the OpenAPI schema. New behavior uses type aliases where possible, but this can generate code which breaks existing builds. Set OldAliasing to true for old behavior. Please see https://github.com/oapi-codegen/oapi-codegen/issues/549" }, "disable-flatten-additional-properties": { "type": "boolean", @@ -82,7 +82,7 @@ }, "disable-required-readonly-as-pointer": { "type": "boolean", - "description": "When an object property is both required and readOnly the go model is generated as a pointer. Set DisableRequiredReadOnlyAsPointer to true to mark them as non pointer. Please see https://github.com/deepmap/oapi-codegen/issues/604" + "description": "When an object property is both required and readOnly the go model is generated as a pointer. Set DisableRequiredReadOnlyAsPointer to true to mark them as non pointer. Please see https://github.com/oapi-codegen/oapi-codegen/issues/604" }, "always-prefix-enum-values": { "type": "boolean", @@ -90,11 +90,11 @@ }, "apply-chi-middleware-first-to-last": { "type": "boolean", - "description": "Our generated code for Chi has historically inverted the order in which Chi middleware is applied such that the last invoked middleware ends up executing first in the Chi chain This resolves the behavior such that middlewares are chained in the order they are invoked. Please see https://github.com/deepmap/oapi-codegen/issues/786" + "description": "Our generated code for Chi has historically inverted the order in which Chi middleware is applied such that the last invoked middleware ends up executing first in the Chi chain This resolves the behavior such that middlewares are chained in the order they are invoked. Please see https://github.com/oapi-codegen/oapi-codegen/issues/786" }, "apply-gorilla-middleware-first-to-last": { "type": "boolean", - "description": "Our generated code for gorilla/mux has historically inverted the order in which gorilla/mux middleware is applied such that the last invoked middleware ends up executing first in the middlewares chain This resolves the behavior such that middlewares are chained in the order they are invoked. Please see https://github.com/deepmap/oapi-codegen/issues/841" + "description": "Our generated code for gorilla/mux has historically inverted the order in which gorilla/mux middleware is applied such that the last invoked middleware ends up executing first in the middlewares chain This resolves the behavior such that middlewares are chained in the order they are invoked. Please see https://github.com/oapi-codegen/oapi-codegen/issues/841" }, "circular-reference-limit": { "type": "integer", diff --git a/examples/anyof-allof-oneof/api.yaml b/examples/anyof-allof-oneof/api.yaml index 493d61b663..61c6a494f1 100644 --- a/examples/anyof-allof-oneof/api.yaml +++ b/examples/anyof-allof-oneof/api.yaml @@ -32,7 +32,7 @@ components: - id # allOf performs a union of all types defined, but if there's a duplicate field defined, it'll be overwritten by the last schema - # https://github.com/deepmap/oapi-codegen/issues/1569 + # https://github.com/oapi-codegen/oapi-codegen/issues/1569 IdentityWithDuplicateField: allOf: # `issuer` will be ignored diff --git a/examples/custom-client-type/doc.go b/examples/custom-client-type/doc.go index 778f8a210a..89172d392e 100644 --- a/examples/custom-client-type/doc.go +++ b/examples/custom-client-type/doc.go @@ -1,6 +1,6 @@ package customclienttype // 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 +// See https://github.com/oapi-codegen/oapi-codegen/issues/785 for why this might be necessary //go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config cfg.yaml api.yaml diff --git a/examples/only-models/api.yaml b/examples/only-models/api.yaml index 4e3d820663..33820e8f0b 100644 --- a/examples/only-models/api.yaml +++ b/examples/only-models/api.yaml @@ -20,7 +20,7 @@ paths: content: application/json: # NOTE that this anonymous object is /not/ generated because it's an anonymous, but would be generated if using `generate: client` - # See https://github.com/deepmap/oapi-codegen/issues/1512 + # See https://github.com/oapi-codegen/oapi-codegen/issues/1512 schema: type: object properties: diff --git a/internal/test/issues/issue-1093/doc.go b/internal/test/issues/issue-1093/doc.go index 7916b330b7..6996cdd2d8 100644 --- a/internal/test/issues/issue-1093/doc.go +++ b/internal/test/issues/issue-1093/doc.go @@ -1,5 +1,5 @@ // This is an example of how to reference models of one api specification from another. -// See https://github.com/deepmap/oapi-codegen/issues/1093 +// See https://github.com/oapi-codegen/oapi-codegen/issues/1093 package issue1093 //go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config parent.cfg.yaml parent.api.yaml diff --git a/pkg/codegen/codegen_test.go b/pkg/codegen/codegen_test.go index 1d752601b3..7b22faed01 100644 --- a/pkg/codegen/codegen_test.go +++ b/pkg/codegen/codegen_test.go @@ -13,7 +13,7 @@ import ( ) const ( - remoteRefFile = `https://raw.githubusercontent.com/deepmap/oapi-codegen/master/examples/petstore-expanded` + + remoteRefFile = `https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/master/examples/petstore-expanded` + `/petstore-expanded.yaml` remoteRefImport = `github.com/oapi-codegen/oapi-codegen/v2/examples/petstore-expanded` ) diff --git a/pkg/codegen/configuration.go b/pkg/codegen/configuration.go index d60eb5ed8b..c2d36f9df0 100644 --- a/pkg/codegen/configuration.go +++ b/pkg/codegen/configuration.go @@ -140,26 +140,26 @@ type CompatibilityOptions struct { // `allOf` merges at the schema definition level, not at the resulting model // level. So, new behavior merges OpenAPI specs but generates different code // than we have in the past. Set OldMergeSchemas to true for the old behavior. - // Please see https://github.com/deepmap/oapi-codegen/issues/531 + // Please see https://github.com/oapi-codegen/oapi-codegen/issues/531 OldMergeSchemas bool `yaml:"old-merge-schemas,omitempty"` // Enum values can generate conflicting typenames, so we've updated the // code for enum generation to avoid these conflicts, but it will result // in some enum types being renamed in existing code. Set OldEnumConflicts to true // to revert to old behavior. Please see: - // Please see https://github.com/deepmap/oapi-codegen/issues/549 + // Please see https://github.com/oapi-codegen/oapi-codegen/issues/549 OldEnumConflicts bool `yaml:"old-enum-conflicts,omitempty"` // It was a mistake to generate a go type definition for every $ref in // the OpenAPI schema. New behavior uses type aliases where possible, but // this can generate code which breaks existing builds. Set OldAliasing to true // for old behavior. - // Please see https://github.com/deepmap/oapi-codegen/issues/549 + // Please see https://github.com/oapi-codegen/oapi-codegen/issues/549 OldAliasing bool `yaml:"old-aliasing,omitempty"` // When an object contains no members, and only an additionalProperties specification, // it is flattened to a map DisableFlattenAdditionalProperties bool `yaml:"disable-flatten-additional-properties,omitempty"` // When an object property is both required and readOnly the go model is generated // as a pointer. Set DisableRequiredReadOnlyAsPointer to true to mark them as non pointer. - // Please see https://github.com/deepmap/oapi-codegen/issues/604 + // Please see https://github.com/oapi-codegen/oapi-codegen/issues/604 DisableRequiredReadOnlyAsPointer bool `yaml:"disable-required-readonly-as-pointer,omitempty"` // When set to true, always prefix enum values with their type name instead of only // when typenames would be conflicting. @@ -167,12 +167,12 @@ type CompatibilityOptions struct { // Our generated code for Chi has historically inverted the order in which Chi middleware is // applied such that the last invoked middleware ends up executing first in the Chi chain // This resolves the behavior such that middlewares are chained in the order they are invoked. - // Please see https://github.com/deepmap/oapi-codegen/issues/786 + // Please see https://github.com/oapi-codegen/oapi-codegen/issues/786 ApplyChiMiddlewareFirstToLast bool `yaml:"apply-chi-middleware-first-to-last,omitempty"` // Our generated code for gorilla/mux has historically inverted the order in which gorilla/mux middleware is // applied such that the last invoked middleware ends up executing first in the middlewares chain // This resolves the behavior such that middlewares are chained in the order they are invoked. - // Please see https://github.com/deepmap/oapi-codegen/issues/841 + // Please see https://github.com/oapi-codegen/oapi-codegen/issues/841 ApplyGorillaMiddlewareFirstToLast bool `yaml:"apply-gorilla-middleware-first-to-last,omitempty"` // CircularReferenceLimit allows controlling the limit for circular reference checking. // In some OpenAPI specifications, we have a higher number of circular diff --git a/pkg/codegen/merge_schemas.go b/pkg/codegen/merge_schemas.go index d2ab35bb7d..04e7b2fa2b 100644 --- a/pkg/codegen/merge_schemas.go +++ b/pkg/codegen/merge_schemas.go @@ -238,7 +238,7 @@ func equalTypes(t1 *openapi3.Types, t2 *openapi3.Types) bool { return false } - // NOTE that ideally we'd use `slices.Equal` but as we're currently supporting Go 1.20+, we can't use it (yet https://github.com/deepmap/oapi-codegen/issues/1634) + // NOTE that ideally we'd use `slices.Equal` but as we're currently supporting Go 1.20+, we can't use it (yet https://github.com/oapi-codegen/oapi-codegen/issues/1634) for i := range s1 { if s1[i] != s2[i] { return false diff --git a/pkg/codegen/schema.go b/pkg/codegen/schema.go index 3d4bdbbddb..86b82a439c 100644 --- a/pkg/codegen/schema.go +++ b/pkg/codegen/schema.go @@ -513,7 +513,7 @@ func GenerateGoSchema(sref *openapi3.SchemaRef, path []string) (Schema, error) { } if len(path) > 1 { // handle additional type only on non-toplevel types // Allow overriding autogenerated enum type names, since these may - // cause conflicts - see https://github.com/deepmap/oapi-codegen/issues/832 + // cause conflicts - see https://github.com/oapi-codegen/oapi-codegen/issues/832 var typeName string if extension, ok := schema.Extensions[extGoTypeName]; ok { typeName, err = extString(extension) diff --git a/pkg/codegen/template_helpers.go b/pkg/codegen/template_helpers.go index 62ea244c8b..b9efe2cf45 100644 --- a/pkg/codegen/template_helpers.go +++ b/pkg/codegen/template_helpers.go @@ -225,7 +225,7 @@ func genResponseUnmarshal(op *OperationDefinition) string { } // Now build the switch statement in order of most-to-least specific: - // See: https://github.com/deepmap/oapi-codegen/issues/127 for why we handle this in two separate + // See: https://github.com/oapi-codegen/oapi-codegen/issues/127 for why we handle this in two separate // groups. fmt.Fprintf(buffer, "switch {\n") for _, caseClauseKey := range SortedMapKeys(handledCaseClauses) { diff --git a/pkg/codegen/test_specs/remote-external-reference.yaml b/pkg/codegen/test_specs/remote-external-reference.yaml index b966df199f..1b425cd134 100644 --- a/pkg/codegen/test_specs/remote-external-reference.yaml +++ b/pkg/codegen/test_specs/remote-external-reference.yaml @@ -21,6 +21,6 @@ components: item: type: object oneOf: - - $ref: 'https://raw.githubusercontent.com/deepmap/oapi-codegen/master/examples/petstore-expanded/petstore-expanded.yaml#/components/schemas/NewPet' + - $ref: 'https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/master/examples/petstore-expanded/petstore-expanded.yaml#/components/schemas/NewPet' required: - item