diff --git a/internal/test/issues/issue1767/config.yaml b/internal/test/issues/issue1767/config.yaml new file mode 100644 index 0000000000..c1bfe0b5b6 --- /dev/null +++ b/internal/test/issues/issue1767/config.yaml @@ -0,0 +1,7 @@ +# yaml-language-server: $schema=../../../../configuration-schema.json +package: issue1767 +generate: + models: true +output: issue1767.gen.go +output-options: + skip-prune: true diff --git a/internal/test/issues/issue1767/generate.go b/internal/test/issues/issue1767/generate.go new file mode 100644 index 0000000000..3f8e1ef572 --- /dev/null +++ b/internal/test/issues/issue1767/generate.go @@ -0,0 +1,3 @@ +package issue1767 + +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml openapi.yaml diff --git a/internal/test/issues/issue1767/issue1767.gen.go b/internal/test/issues/issue1767/issue1767.gen.go new file mode 100644 index 0000000000..1e7bdaddbb --- /dev/null +++ b/internal/test/issues/issue1767/issue1767.gen.go @@ -0,0 +1,17 @@ +// Package issue1767 provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.0.0-00010101000000-000000000000 DO NOT EDIT. +package issue1767 + +import ( + openapi_types "github.com/oapi-codegen/runtime/types" +) + +// Alarm Alarm Information +type Alarm struct { + // UnderscoreId Identifier of the Alarm. + UnderscoreId *openapi_types.UUID `json:"_id,omitempty"` + + // Id Identifier of the Alarm. + Id *openapi_types.UUID `json:"id,omitempty"` +} diff --git a/internal/test/issues/issue1767/openapi.yaml b/internal/test/issues/issue1767/openapi.yaml new file mode 100644 index 0000000000..5964395ed0 --- /dev/null +++ b/internal/test/issues/issue1767/openapi.yaml @@ -0,0 +1,20 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: "An underscore in the name of a field is remapped to `Underscore`" +paths: +components: + schemas: + Alarm: + description: | + Alarm Information + type: object + properties: + _id: + description: Identifier of the Alarm. + type: string + format: uuid + id: + description: Identifier of the Alarm. + type: string + format: uuid