Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port attribute in route should be nullable #384

Closed
Dray56 opened this issue Feb 21, 2024 · 0 comments
Closed

Port attribute in route should be nullable #384

Dray56 opened this issue Feb 21, 2024 · 0 comments

Comments

@Dray56
Copy link
Contributor

Dray56 commented Feb 21, 2024

According to the cloudfoundry docs, port parameter of route can be null. If that is the case the port attribute in the route struct should be nullable.

type Route struct {
	Host         string             `json:"host"`
	Path         string             `json:"path"`
	URL          string             `json:"url"`
	Protocol     string             `json:"protocol"`
	Port         int                `json:"port"`
	Destinations []RouteDestination `json:"destinations"`

	Metadata      *Metadata          `json:"metadata"`
	Relationships RouteRelationships `json:"relationships"`
	Resource      `json:",inline"`
}

However in the existing structure, port is just an integer so while receiving the response null values will get converted to arbitrary integer values. Better will be to change it to a pointer.

Dray56 referenced this issue in Dray56/go-cfclient Feb 21, 2024
Signed-off-by: Debaditya Ray <debaditya.ray@sap.com>
sneal referenced this issue Feb 21, 2024
fix: port attribute in route cloudfoundry-community#384
@sneal sneal closed this as completed Feb 21, 2024
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

No branches or pull requests

2 participants