Skip to content

Commit

Permalink
fix: Minor corrections to Swagger/JSON schema (#7027)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec authored Oct 22, 2021
1 parent 93c301d commit ba472e1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 136 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,11 @@ dist/swaggifed.swagger.json: dist/mixed.swagger.json hack/swaggify.sh
dist/kubeified.swagger.json: dist/swaggifed.swagger.json dist/kubernetes.swagger.json
go run ./hack/swagger kubeifyswagger dist/swaggifed.swagger.json dist/kubeified.swagger.json

api/openapi-spec/swagger.json: $(GOPATH)/bin/swagger dist/kubeified.swagger.json
swagger flatten --with-flatten minimal --with-flatten remove-unused dist/kubeified.swagger.json -o api/openapi-spec/swagger.json
dist/swagger.0.json: $(GOPATH)/bin/swagger dist/kubeified.swagger.json
swagger flatten --with-flatten minimal --with-flatten remove-unused dist/kubeified.swagger.json -o dist/swagger.0.json

api/openapi-spec/swagger.json: $(GOPATH)/bin/swagger dist/swagger.0.json
swagger flatten --with-flatten remove-unused dist/swagger.0.json -o api/openapi-spec/swagger.json

api/jsonschema/schema.json: api/openapi-spec/swagger.json hack/jsonschema/main.go
go run ./hack/jsonschema
Expand Down
71 changes: 0 additions & 71 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7722,41 +7722,6 @@
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.WorkflowTaskSet": {
"properties": {
"apiVersion": {
"const": "argoproj.io/v1alpha1",
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"const": "WorkflowTaskSet",
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
},
"spec": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTaskSetSpec"
},
"status": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTaskSetStatus"
}
},
"required": [
"metadata",
"spec"
],
"type": "object",
"x-kubernetes-group-version-kind": [
{
"group": "argoproj.io",
"kind": "WorkflowTaskSet",
"version": "v1alpha1"
}
]
},
"io.argoproj.workflow.v1alpha1.WorkflowTaskSetSpec": {
"properties": {
"tasks": {
Expand Down Expand Up @@ -10864,39 +10829,6 @@
},
"type": "object"
},
"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": {
"description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.",
"properties": {
"causes": {
"description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.",
"items": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"
},
"type": "array"
},
"group": {
"description": "The group attribute of the resource associated with the status StatusReason.",
"type": "string"
},
"kind": {
"description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"name": {
"description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).",
"type": "string"
},
"retryAfterSeconds": {
"description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.",
"type": "integer"
},
"uid": {
"description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids",
"type": "string"
}
},
"type": "object"
},
"io.k8s.apimachinery.pkg.apis.meta.v1.Time": {
"description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.",
"format": "date-time",
Expand Down Expand Up @@ -11045,9 +10977,6 @@
},
{
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTemplate"
},
{
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTaskSet"
}
],
"type": "object"
Expand Down
62 changes: 2 additions & 60 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"title": "Argo Server API",
"version": "VERSION"
},
"host": "localhost:2746",
"paths": {
"/api/v1/archived-workflows": {
"get": {
Expand Down Expand Up @@ -4193,7 +4194,7 @@
},
{
"type": "string",
"name": "name",
"name": "uid",
"in": "path",
"required": true
},
Expand Down Expand Up @@ -11955,32 +11956,6 @@
}
}
},
"io.argoproj.workflow.v1alpha1.WorkflowTaskSet": {
"type": "object",
"required": [
"metadata",
"spec"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.io.k8s.community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
},
"spec": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTaskSetSpec"
},
"status": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTaskSetStatus"
}
}
},
"io.argoproj.workflow.v1alpha1.WorkflowTaskSetSpec": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -15079,39 +15054,6 @@
}
}
},
"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": {
"description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.",
"type": "object",
"properties": {
"causes": {
"description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.",
"type": "array",
"items": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"
}
},
"group": {
"description": "The group attribute of the resource associated with the status StatusReason.",
"type": "string"
},
"kind": {
"description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"name": {
"description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).",
"type": "string"
},
"retryAfterSeconds": {
"description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.",
"type": "integer"
},
"uid": {
"description": "UID of the resource. (when there is a single resource which can be described). More info: http://kubernetes.io/docs/user-guide/identifiers#uids",
"type": "string"
}
}
},
"io.k8s.apimachinery.pkg.apis.meta.v1.Time": {
"description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.",
"type": "string",
Expand Down
2 changes: 0 additions & 2 deletions hack/jsonschema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func main() {
"Workflow",
"WorkflowEventBinding",
"WorkflowTemplate",
"WorkflowTaskSet",
} {
v := definitions.(obj)["io.argoproj.workflow.v1alpha1."+kind].(obj)
v["x-kubernetes-group-version-kind"] = []map[string]string{
Expand All @@ -49,7 +48,6 @@ func main() {
obj{"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.Workflow"},
obj{"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowEventBinding"},
obj{"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTemplate"},
obj{"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowTaskSet"},
},
"definitions": definitions,
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/apiclient/_.primary.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"http",
"https"
],
"host": "localhost:2746",
"info": {
"title": "Argo Server API",
"description": "You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9`",
Expand Down Expand Up @@ -197,7 +198,7 @@
},
{
"type": "string",
"name": "name",
"name": "uid",
"in": "path",
"required": true
},
Expand Down

0 comments on commit ba472e1

Please sign in to comment.