-
-
Notifications
You must be signed in to change notification settings - Fork 887
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
API platform 3.2 feedbacks #5793
Comments
When I run
I think it should be And later, more critically:
I might be missing a config file change, but I didn't see anything mentioned in the notes. I'm not intentionally using GraphQL in my project. |
Thanks @paullallier I just fixed these on |
I grabbed dev-main to have another quick look. I'm seeing an issue with the Swagger docs, but that might be something specific to the (probably) wrong why I'm defining my entity relations. Specifically, it doesn't seem happy if the parameter defaults to null (or possibly just if it's nullable)
In dev-main (f02f379): Note, "items" is a ?ArrayCollection of InvoiceInItem Enities, but the way I've defined it is probably non-standard. It was pulling the structure inside an InvoiceInItem into the InvoiceIn schema correctly before, however. |
Interesting isn't that the case in 3.1 though? you'd need to check if the generated schema is correct I don't think we changed this part of the code. https://github.com/api-platform/core/releases/tag/v3.2.0-alpha.2 released, note that we have a few issues to fix:
Apart from that I think that the next features will reach 3.3 (in 6 months). |
The schema for that request body in v3.2.0-beta2 is:
and in v3.1.17 I get:
The null issue might be related to this, if we have the affected version of SwaggerUI in 3.2 and not in 3.1? swagger-api/swagger-ui#9056 But I'm not sure why I'm losing the definition of the items array in 3.2, or why the nullable string types have changes from |
On the plus side, if I skip all my assertMatchesResourceItemJsonSchema checks, all my test cases pass with v3.2.0-alpha.2. My code is heavy on custom StateProcessor/Provider logic and doesn't use Doctrine ORM for DB access. |
/edit: actually I think that this is the prefered way with OpenAPI, maybe we should update Swagger UI ? The assertion needs a fix I guess? |
We're upgrading Swagger UI to its latest version, it fixes the About your other issues (#5793 (comment) and #5793 (comment)), can you give us a reproducer please? |
This is fixed, note that schemas have the same output now but swagger ui displays them differently. |
Thanks @soyuka, @vincentchalamon. It's a lot better, but there's still something odd in the schema, unfortunately. Possibly I'm getting json schema labelled as jsonld in a few cases? My schema match assertions are failing when checking the items inside a subresource collection - detecting the type as "unknown-type" rather than "object" The other issues I mentioned here also remain - in case they were overlooked when fixing the schema. #5810 (comment) EDIT: Oh and noting from your comment that this change of display is probably a feature of the updated SwaggerUI, so not in scope. And that the bits highlighted in yellow, above, might be the correct way to define this for Swagger too. |
@paullallier you tried dev-main? What's the failing use case? subresource collection like |
@soyuka Yes, that was with dev-main from a few days ago. But there's an example repo here: And the problem with the non-docs page: And the problem with the reference back to BagOfTests from TestEntity (if you look at the request and response body on the POST /api/test_entities endpoint, for example). All look OK if I require v3.1.18 instead. I don't have any subresource endpoints in there (and I don't think I use them in the intended way on my project anyway), so I can't speak for those. It's definitely possible that I've incorrectly defined something though. Though there isn't much in the repo to mis-define. |
I haven't actually tried persisting and retrieving data from a database with that - but as far as I know (since my tests on my project work) it's only a schema / web page issue. Since I don't use Doctrine ORM though, I can't be certain. |
Hello, Looks like there is a bug... after upgrading to the Let's say I have a What should happen? I should receive a This commit works: 2efdc7d After that commit Probably it was broken in #5657 (wasn't able to check since it's throwing a Graphql validation error which was fixed in 7ecfdff) Thanks! |
I can confirm this bug was introduced in afb739b. Investigation in progress |
@soyuka It looks like the http://localhost:8000/api page switches to json rather than html at this commit. I think there's a change of config variable names at that point - perhaps the default is bad? Not sure. And the schema display for TestEntity.json-ld.write - I'm not actually sure I should expect this to have @context, etc fields? Looking at my current project with v3.1.16, some of these ...json-ld.write entries have @context and some do not - and I don't instantly see a pattern. |
For any entities that contain many-to-many relationships, pages created using the next-gen will not work. I have an error : |
Use this issue to send feedbacks on the next-gen API Platforms version.
Thanks for the support!
The text was updated successfully, but these errors were encountered: