Skip to content

feat(json-schema): mutualize json schema between formats #6960

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

Merged
merged 3 commits into from
May 21, 2025

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 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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
close