-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
The OSM SOL005 API spec has a bunch of objects that define the following two ID fields:
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
The generated go code becomes:
// Alarm Alarm Information
type Alarm struct {
// Id Identifier of the Alarm.
Id openapi_types.UUID `json:"_id"`
// Id Identifier of the Alarm.
Id openapi_types.UUID `json:"id"`
Which causes a compile error.
For reference, using config.yaml of
package: osmapi
generate:
models: true
client: true
output: osm-generated.go
and
gen.go:
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen --config=config.yaml SOL005.yaml
package osmapi
I believe there needs to be some logic that checks that renaming a field that starts with underscore doesn't conflict with the names of any other fields.
Btw this is a really great project, it's been very helpful for my work, thanks so much for creating it.
jonathanfoster
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working