Skip to content

Commit

Permalink
fix: correct discrepancies in generated swagger file (argoproj#14813)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
  • Loading branch information
alexmt authored Aug 3, 2023
1 parent 8270225 commit fc60f00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
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)' | \
jq '.definitions.v1alpha1ResourceNode.allOf = [{"$ref": "#/definitions/v1alpha1ResourceRef"}] | del(.definitions.v1alpha1ResourceNode.properties.resourceRef) ' \
> "${SWAGGER_OUT}"

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

0 comments on commit fc60f00

Please sign in to comment.