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

fix: correct discrepancies in generated swagger file #14813

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5654,19 +5654,8 @@
},
"v1Time": {
"description": "Time is a wrapper around time.Time which supports correct\nmarshaling to YAML and JSON. Wrappers are provided for many\nof the factory methods that the time package offers.\n\n+protobuf.options.marshal=false\n+protobuf.as=Timestamp\n+protobuf.options.(gogoproto.goproto_stringer)=false",
"type": "object",
"properties": {
"nanos": {
"description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive. This field may be limited in precision depending on context.",
"type": "integer",
"format": "int32"
},
"seconds": {
"description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.",
"type": "string",
"format": "int64"
}
}
"type": "string",
"format": "date-time"
},
"v1alpha1AWSAuthConfig": {
"type": "object",
Expand Down Expand Up @@ -8223,13 +8212,15 @@
"$ref": "#/definitions/v1alpha1ResourceRef"
}
},
"resourceRef": {
"$ref": "#/definitions/v1alpha1ResourceRef"
},
"resourceVersion": {
"type": "string"
}
}
},
"allOf": [
{
"$ref": "#/definitions/v1alpha1ResourceRef"
}
]
},
"v1alpha1ResourceOverride": {
"type": "object",
Expand Down
5 changes: 4 additions & 1 deletion hack/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ EOF
del(.definitions.v1alpha1OptionalArray) |
.definitions.v1alpha1ApplicationSourcePluginParameter.properties.map = {"description":"Map is the value of a map type parameter.","type":"object","additionalProperties":{"type":"string"}} |
del(.definitions.v1alpha1OptionalMap)
' "${COMBINED_SWAGGER}" > "${SWAGGER_OUT}"
' "${COMBINED_SWAGGER}" | \
jq '.definitions.v1Time.type = "string" | .definitions.v1Time.format = "date-time" | del(.definitions.v1Time.properties)' | \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've Wastet couple of hours researching and could not find better than do fix swagger other than manually modify it :(

Copy link
Member

Choose a reason for hiding this comment

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

That's been my experience every time the swagger doc has been wrong. 😛

jq '.definitions.v1alpha1ResourceNode.allOf = [{"$ref": "#/definitions/v1alpha1ResourceRef"}] | del(.definitions.v1alpha1ResourceNode.properties.resourceRef) ' \
> "${SWAGGER_OUT}"

/bin/rm "${PRIMARY_SWAGGER}" "${COMBINED_SWAGGER}"
}
Expand Down