Skip to content

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Feb 9, 2025

Q A
Branch? main
Tickets starts fixing #6485
License MIT

Instead of generating twice a definition for 2 different formats, we generate the json one and reference the json format inside the jsonld format:

https://gist.github.com/soyuka/20d0d216c3fce1b68165dbbf58381e02

When generating a single resource on our TestBundle we lower the OpenAPI file size quite a bit:

  • 12K on 4.1
  • 8.0K with this patch

Left to be done:

@soyuka soyuka force-pushed the feat/json-schema branch 3 times, most recently from 981e6e1 to 86c39da Compare February 10, 2025 16:57
@soyuka soyuka changed the title feat(json-schema): use $id and $ref between json formats feat(json-schema): mutualize json schema between formats Feb 10, 2025
@soyuka soyuka force-pushed the feat/json-schema branch 3 times, most recently from 5e66fd1 to 33dc6fa Compare February 11, 2025 10:17
@soyuka soyuka force-pushed the feat/json-schema branch 2 times, most recently from dea48d6 to 7cc3f8c Compare February 14, 2025 21:05
@stale
Copy link

stale bot commented Apr 29, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 29, 2025
@stale stale bot closed this May 6, 2025
@soyuka soyuka reopened this May 6, 2025
@stale stale bot removed the stale label May 6, 2025
@soyuka soyuka force-pushed the feat/json-schema branch from 2a3c385 to b6f84b2 Compare May 7, 2025 09:10
@soyuka soyuka force-pushed the feat/json-schema branch 7 times, most recently from 6823232 to 5908915 Compare May 15, 2025 08:02
soyuka added 2 commits May 15, 2025 10:05
note that the test in docs.feature has been moved to phpunit
@soyuka soyuka force-pushed the feat/json-schema branch 2 times, most recently from c7f58bb to ffd782d Compare May 15, 2025 08:10
@soyuka soyuka force-pushed the feat/json-schema branch 5 times, most recently from bee49ae to 88ff9fb Compare May 16, 2025 13:19
@soyuka soyuka force-pushed the feat/json-schema branch 2 times, most recently from e68a981 to 651e978 Compare May 19, 2025 12:00
@soyuka soyuka marked this pull request as ready for review May 19, 2025 12:00
@soyuka soyuka force-pushed the feat/json-schema branch 3 times, most recently from 4f84825 to e620f9b Compare May 19, 2025 13:04
@soyuka soyuka force-pushed the feat/json-schema branch from e620f9b to 9f29a3c Compare May 19, 2025 13:05
@soyuka soyuka merged commit 79edced into api-platform:main May 21, 2025
97 checks passed
@soyuka soyuka deleted the feat/json-schema branch May 21, 2025 07:47
@ttskch
Copy link
Contributor

ttskch commented Aug 30, 2025

@soyuka Thank you for the great job!

@vinise
Copy link
Contributor

vinise commented Oct 13, 2025

@soyuka
We are now using "allOf" to combine based and specific schemas.
this is not a real inheritance, just combine all schemas with no precedence (at least, I understand it like that)

For HydraCollectionBaseSchema this seems problematic, as it defines a property "member" with a simple "object" type (no specific type specified)
On a collection object, the property "member" is redefined with correct typing.

As order should not impact the schema, client generation libraries have no idea of which "member" definition to take
for ex "heyapi" is even generating a member with 2 possible type

Shouldn't we remove member definition from HydraCollectionBaseSchema ? and keep only the correct full typed one ?

BacLuc added a commit to BacLuc/ecamp3 that referenced this pull request Dec 7, 2025
With
- api-platform/core#6960
generating the nested write payload objects via the schema completely broke.
The examples in the OpenApi Webui are still broken.
BacLuc added a commit to ecamp/ecamp3 that referenced this pull request Dec 7, 2025
With
- api-platform/core#6960
generating the nested write payload objects via the schema completely broke.
The examples in the OpenApi Webui are still broken.
BacLuc added a commit to ecamp/ecamp3 that referenced this pull request Dec 7, 2025
With
- api-platform/core#6960
generating the nested write payload objects via the schema completely broke.
The examples in the OpenApi Webui are still broken.
BacLuc added a commit to ecamp/ecamp3 that referenced this pull request Dec 7, 2025
With
- api-platform/core#6960
generating the nested write payload objects via the schema completely broke.
The examples in the OpenApi Webui are still broken.
BacLuc added a commit to ecamp/ecamp3 that referenced this pull request Dec 7, 2025
With
- api-platform/core#6960
generating the nested write payload objects via the schema completely broke.
The examples in the OpenApi Webui are still broken.
BacLuc added a commit to ecamp/ecamp3 that referenced this pull request Dec 7, 2025
With
- api-platform/core#6960
generating the nested write payload objects via the schema completely broke.
The examples in the OpenApi Webui are still broken.
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

Successfully merging this pull request may close these issues.

3 participants