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

continuing support for JSON #6942

Closed
BernardA opened this issue Feb 5, 2025 · 2 comments
Closed

continuing support for JSON #6942

BernardA opened this issue Feb 5, 2025 · 2 comments

Comments

@BernardA
Copy link

BernardA commented Feb 5, 2025

I am getting this deprecation notice:

Since api-platform/core 3.2: The "json" format is too broad, use ["jsonopenapi" => ["application/vnd.openapi+json"]] instead.

We have dozens of API's in our organization, using several stacks ( PHP, Java ) with multiple consummers and JSON is the standard interface format.

When I see the above deprecation notice I get concerned and wonder what's the intention and plans for API-Platform.

Having JSON format is a must. We do not want nor plan to move to JSON API, as nice a format as it may be.

So, the question is: is API-Platform going to continue to support JSON and I can safely ignore the above deprecation notice, or what are the plans?

Thanks

@soyuka
Copy link
Member

soyuka commented Feb 5, 2025

We're not deprecating nor stopping the use of JSON, we added a specific content-negotiation format for openapi, fix the deprecation by adjusting your formats in the configuration to:

jsonopenapi: ['application/vnd.openapi+json'],
json: ['application/json']

@BernardA
Copy link
Author

BernardA commented Feb 7, 2025

Thanks @soyuka

Here is the config that fixed the deprecation:

formats:
    jsonopenapi: ['application/vnd.openapi+json']
    json:     ['application/json']
    html:     ['text/html']  

docs_formats:
    jsonopenapi: ['application/vnd.openapi+json']
    json:     ['application/json']
    html:     ['text/html']`

@BernardA BernardA closed this as completed Feb 7, 2025
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

2 participants