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

Disallow nested arrays|objects within query parameters #18

Open
charjr opened this issue Apr 24, 2024 · 0 comments
Open

Disallow nested arrays|objects within query parameters #18

charjr opened this issue Apr 24, 2024 · 0 comments

Comments

@charjr
Copy link
Collaborator

charjr commented Apr 24, 2024

Referring to Swagger's serialisation docs

Under the style:deepObject it specifies the following:

The behavior for nested objects and arrays is undefined.

It only states this on deepObject, however I suspect the behaviour would be undefined for all query parameters as RFC6570 has no comments on such data either.

I also suspect that path parameters will follow the same limitations.

Requirements to disallow this:

  • Schemas need to create new Schemas for defined items, properties and additionalProperties

  • Schemas need to provide access to the items, properties and additionalProperties

  • Because of the potential to get mixed up in allOf, anyOf and oneOf the Schema itself will need methods such as canItemsBe(Type), canPropertiesBe(Type) and canAdditionalPropertiesBe(Type) which recursively call the same methods on subSchemas.

  • Lastly the Parameter will be able to call these methods i.e.

if ($schema->canBe(Type::Array) && $schema->itemsCanBe(Type::Array)) {
  // do something
}
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

No branches or pull requests

1 participant