Skip to content

fix(laravel): add contact & license options to fix swagger UI issues #6802

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

Closed
wants to merge 19 commits into from

Conversation

nolotz
Copy link
Contributor

@nolotz nolotz commented Nov 16, 2024

While using the latest version of API Platform in a Laravel application, issues arise with the Swagger UI frontend. Upon investigation, the root cause seems to be missing license and contact information in the generated OpenAPI schema.

However, these fields are not configurable via the existing configuration, requiring users to override the options singleton manually to resolve the issue.

The lack of these fields leads to the following error:

root-injects.jsx:85 TypeError: Cannot read properties of null (reading 'size')
    at oas31_components_info (info.jsx:60:16)
    ...

This bugfix request proposes adding support for configuring license and contact fields directly via the configuration, ensuring the Swagger UI renders without issues.

Steps to Reproduce

  • Install the latest version of API Platform in a Laravel application.
  • Configure Swagger UI without specifying license and contact fields.
  • Open the Swagger UI in a browser.
  • Observe the rendering error in the console logs.

valentindrdt and others added 19 commits September 18, 2024 18:02
* feat: if a policy matches the name of a model we automatically register it, no need to do it manually anymore

* fix: optimising the way we handle collection

* fix: phpstan

* fix: cs-fixer
* feat: add hal support for laravel

* feat: quick review

* fix: typo & cs-fixer

* fix: typo in composer.json

* fix: cs-fixer & phpstan

* fix: forgot about hal item normalizer, therefore there's no more createbook nor updatebook test as Hal is a readonly format
@nolotz
Copy link
Contributor Author

nolotz commented Nov 16, 2024

The failing test does not seem to be related to this change; it appears to be an existing issue on the current main branch.

https://github.com/api-platform/core/actions/runs/11854768322/job/33037604217

@soyuka
Copy link
Member

soyuka commented Nov 18, 2024

targetting 4.0 at #6804

@soyuka soyuka closed this Nov 18, 2024
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.

6 participants