Skip to content

"Any Type" not supported #36

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

Open
diogobaeder opened this issue May 17, 2018 · 3 comments
Open

"Any Type" not supported #36

diogobaeder opened this issue May 17, 2018 · 3 comments

Comments

@diogobaeder
Copy link

"Any Type" is part of the specification ( https://swagger.io/docs/specification/data-models/data-types/#any ), however this library does not support it.

The problem seems that, when creating the Schema for a schema spec that has {} as its value (meaning "anything can be used as input here"), it is created with an object type - see here: https://github.com/p1c2u/openapi-core/blob/master/openapi_core/schemas.py#L179 - it tries to infer "object" by default.

After checking the schema types ( https://github.com/p1c2u/openapi-core/blob/master/openapi_core/enums.py#L27 ) I can see that "any" is not there.

Please let me know if you need help with implementing that.

Thanks,
Diogo

@p1c2u
Copy link
Collaborator

p1c2u commented May 30, 2018

@diogobaeder this is tricky one. I need to have #34 AnyOf supprt done first.

@diogobaeder
Copy link
Author

No problem. I was actually trying to use "Any Type" as a hack in place of oneOf, but now that you implemented oneOf I won't need this so soon. Thanks!

@p1c2u p1c2u mentioned this issue Aug 2, 2018
@p1c2u p1c2u added the area/schema Indicates an issue on schema area label Aug 17, 2018
@mmerickel
Copy link

mmerickel commented Apr 22, 2020

I'm also trying to use the any type. It's sort of working but I receive an unmarshaller warning that seems like it should just be removed? I'm using the following schema and data.

TemplateField:
  type: object
  properties:
    name:
      type: string
    default:
      nullable: true
{
  "name": "foo",
  "default": None
}

https://github.com/p1c2u/openapi-core/blob/97ec8c796746f72ef3298fe92078b5f80e1f66f7/openapi_core/unmarshalling/schemas/unmarshallers.py#L266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants