Skip to content

add api-platform for a more complete API #1491

@tacman

Description

@tacman

I submitted a PR to fix #1488 , but it feels clunky. We can get pagination, filtering and sorting with a consistent and well-loved API by configuring API platform.

Since /api is already used, we could use /api2 or /apip for the route. Then with very little work we can search by multiple vendors or types, paginate, etc.

image

I'm happy to make a PR with this, maybe mark it as experimental during development?

I just submitted a PR to fix an api platform issue (symfony/symfony#58928 (comment)) but with that fix, I still can't get it to work because of a nelmio_security.yaml setting, without commenting this out.

#            script-src:
#                - 'unsafe-eval' # TODO get rid of this, but it requires getting rid of hogan (part of instantsearch, maybe upgrade to v4 will fix this)
#                - 'https://www.gstatic.com/recaptcha/' # TODO could be replaced by simply 'https:' for simplicity's sake once strict-dynamic support is more broadly available 75% in early 2022 per https://caniuse.com/?search=csp%20strict-dynamic
#                - 'strict-dynamic'

I also had to tweak the stateless setting. Both of these are small.

Is the packagist data available as a dump for testing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions