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

Use type "object" instead of type "any" to represent unstructured objects #270

Merged
merged 1 commit into from
Mar 11, 2016

Conversation

nikhiljindal
Copy link
Contributor

emicklei added a commit that referenced this pull request Mar 11, 2016
Use type "object" instead of type "any" to represent unstructured objects
@emicklei emicklei merged commit 402f11d into emicklei:master Mar 11, 2016
@emicklei
Copy link
Owner

Thank you for this change. Wasn't there an affected test?

@nikhiljindal
Copy link
Contributor Author

None that I am aware of :)

Thanks for the quick merge!

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this pull request Apr 15, 2016
Automatic merge from submit-queue

Updating go-restful to generate "type":"object" instead of "type":"any" in swagger-spec (breaks kubectl 1.1)

Updating go-restful to include emicklei/go-restful#270 (replacing type "any" by type "object". Ref swagger-api/swagger-codegen#2347 on why we want to do that)
Ref #4700 (comment)

First commit generated using:
```
godep restore
go get -u github.com/emicklei/go-restful
godep update github.com/emicklei/go-restful
```

Second commit generated by running 
```
./hack/update-swagger-spec.sh
```

Third commit generated by running:
```
./hack/update-api-reference-docs.sh
```

cc @kubernetes/sig-api-machinery @bgrant0607
@whitlockjc
Copy link

I'm not sure this is the best idea. type: any tells me that the value can be anything, including an array or a primitives. type: object will fail validation for arrays and primitives so if you supported type: any to mean any value should pass validation, then type: object will not suffice. The real allow any value to pass validation is the empty schema, or {}. I realize that the fix for this works well for Kubernetes but I've also commented on this matter there. Any JSON Schema validator would fail validation if you use type: object and give it an array or primitive.

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.

None yet

3 participants