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

refactor: PropertyDescribers #2184

Merged

Conversation

DjordyKoert
Copy link
Collaborator

@DjordyKoert DjordyKoert commented Jan 9, 2024

Refactor to the behaviour of the property describers:

  • Automatic tagging for PropertyDescriberInterface with nelmio_api_doc.swagger.processor. This makes it easier for users of the bundle the create their own property describers.
  • Deprecate NullablePropertyTrait in favor of using a property describer service.
    • Implement a nullable property describer as replacement
    • Implement PropertyDescriberAwareTrait & PropertyDescriberAwareInterface to allow 'chaining' of describers
  • Refactor PropertyDescriberInterface dependency injection by no longer requiring to pass an array of describers
    • Potential BC: ArrayPropertyDesciber & CompoundPropertyDesciber constructor removed
      • Quick search through github shows no impact to other codebases for this

ObjectModelDescriber changes:

  • Deprecate injection of PropertyDescriberInterface[] in favor of a single PropertyDescriberInterface
  • Require symfony/deprecation-contracts to ease deprecations

Additional change:

@DjordyKoert DjordyKoert self-assigned this Jan 9, 2024
<tag name="nelmio_api_doc.object_model.property_describer"/>
</instanceof>

<service id="Nelmio\ApiDocBundle\PropertyDescriber\PropertyDescriberInterface" alias="nelmio_api_doc.object_model.property_describer"/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this to prevent users from unintentionally injecting this in unrelated services. Use the PropertyDescriberAware instead

@DjordyKoert DjordyKoert force-pushed the feat-better-required-documentation branch from 99631ae to a54370a Compare January 10, 2024 14:51
@DjordyKoert DjordyKoert force-pushed the feat-better-required-documentation branch from a54370a to bde94dd Compare January 10, 2024 14:53
@DjordyKoert DjordyKoert force-pushed the feat-better-required-documentation branch from d924757 to 0938170 Compare January 10, 2024 15:55
@DjordyKoert DjordyKoert merged commit b200bc1 into nelmio:master Jan 10, 2024
13 checks passed
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.

None yet

1 participant