Skip to content

Conversation

@ctreatma
Copy link
Contributor

No description provided.

Comment on lines -92 to -127
// check if the discriminator value is 'BgpRoutingProtocolRequest'
if jsonDict["type"] == "BgpRoutingProtocolRequest" {
// try to unmarshal JSON data into BgpRoutingProtocolRequest
err = json.Unmarshal(data, &dst.BgpRoutingProtocolRequest)
if err == nil {
return nil // data stored in dst.BgpRoutingProtocolRequest, return on the first match
} else {
dst.BgpRoutingProtocolRequest = nil
return fmt.Errorf("failed to unmarshal ServiceRequestAllOfRoutingProtocol as BgpRoutingProtocolRequest: %s", err.Error())
}
}

// check if the discriminator value is 'DirectRoutingProtocolRequest'
if jsonDict["type"] == "DirectRoutingProtocolRequest" {
// try to unmarshal JSON data into DirectRoutingProtocolRequest
err = json.Unmarshal(data, &dst.DirectRoutingProtocolRequest)
if err == nil {
return nil // data stored in dst.DirectRoutingProtocolRequest, return on the first match
} else {
dst.DirectRoutingProtocolRequest = nil
return fmt.Errorf("failed to unmarshal ServiceRequestAllOfRoutingProtocol as DirectRoutingProtocolRequest: %s", err.Error())
}
}

// check if the discriminator value is 'StaticRoutingProtocolRequest'
if jsonDict["type"] == "StaticRoutingProtocolRequest" {
// try to unmarshal JSON data into StaticRoutingProtocolRequest
err = json.Unmarshal(data, &dst.StaticRoutingProtocolRequest)
if err == nil {
return nil // data stored in dst.StaticRoutingProtocolRequest, return on the first match
} else {
dst.StaticRoutingProtocolRequest = nil
return fmt.Errorf("failed to unmarshal ServiceRequestAllOfRoutingProtocol as StaticRoutingProtocolRequest: %s", err.Error())
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code removed here is effectively unreachable; it tests for type property values that do not exist in the spec. The spec-derived type checks immediately precede the removed code in this file and they check for values that are actually defined in the spec.

@ctreatma ctreatma force-pushed the upgrade-openapi-generator branch from 9daf05a to a61f2c4 Compare December 18, 2025 15:52
@ctreatma ctreatma marked this pull request as ready for review December 22, 2025 17:39
@ctreatma ctreatma requested review from a team as code owners December 22, 2025 17:39
@ctreatma ctreatma merged commit 7ae7a56 into main Dec 22, 2025
6 checks passed
@ctreatma ctreatma deleted the upgrade-openapi-generator branch December 22, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants