Skip to content

Webhook openAPI spec and code disagrees on property casing #5110

@roosmaa

Description

@roosmaa

What happened:

In the api/webhook.yaml openAPI spec, the changes component lists the properties as starting with lower-case.

create:
$ref: '#/components/schemas/endpoints'
updateOld:
$ref: '#/components/schemas/endpoints'
updateNew:
$ref: '#/components/schemas/endpoints'
delete:
$ref: '#/components/schemas/endpoints'

However, the Changes struct in Go side doesn't have the JSON tag giving it an eplicit name, so Go will default to the field names (Create, UpdateOld, UpdateNew, Delete) in the generated JSON.

type Changes struct {
// Records that need to be created
Create []*endpoint.Endpoint
// Records that need to be updated (current data)
UpdateOld []*endpoint.Endpoint
// Records that need to be updated (desired data)
UpdateNew []*endpoint.Endpoint
// Records that need to be deleted
Delete []*endpoint.Endpoint
}

What you expected to happen:

I would expect the openAPI spec and code to agree. Even though Go doesn't care about casing, other platforms do.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • External-DNS version (use external-dns --version): v0.15.1
  • DNS provider: webhook
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions