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

Possible Support for Schemaless Request Payload #2222

Closed
ragboyjr opened this issue Oct 1, 2018 · 3 comments
Closed

Possible Support for Schemaless Request Payload #2222

ragboyjr opened this issue Oct 1, 2018 · 3 comments

Comments

@ragboyjr
Copy link
Contributor

ragboyjr commented Oct 1, 2018

When creating endpoints for webhooks, you typically need to have an endpoint that can support an array of different request schemas. And those schemas aren't necessarily defined by you, but the service you are accepting webhook requests from.

Currently, every resource defined needs to have properties else an exception is thrown during the property access for the resource.

Currently, to get around this issue, i've built a custom normalizer decorator for the swagger documentation normalizer and just merge in my own swagger definition for a custom endpoint, and then just use a standard SF controller with routing to provide the endpoint.

But I was thinking this is something API Platform might be able to support a little better by maybe providing a standard DataBagResource class or something, but i'm not entirely sure.

Either way, it was kind of a pain to dig through and find out how to extend the swagger docs to add custom paths to make sure the API was fully documented when I need to just use a standard SF controller. Hoping this ticket might lead to a discussion on a better way to do this, or at least to some documentation for the community.

@ragboyjr
Copy link
Contributor Author

ragboyjr commented Oct 1, 2018

Allowing a swagger_context definition on a custom SF route like for the collection/item operation endpoints would probably suffice and be a clean solution.

@ragboyjr
Copy link
Contributor Author

ragboyjr commented Oct 5, 2018

Working around this with using https://github.com/krakphp/api-platform-extra#additional-swagger-documentation for now.

@soyuka
Copy link
Member

soyuka commented Oct 17, 2023

closing as old and I think it's possible now

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