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

Mark behaviour callback implementations with @impl attribute #51

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

McSym28
Copy link
Contributor

@McSym28 McSym28 commented Jun 5, 2024

When trying to implement my own OpenAPI.Processor or OpenAPI.Renderer AND adding @impl attribute to my own callback implementations, I'm getting the following warning (one of):

    warning: module attribute @impl was not set for function schema_format/2 callback (specified in OpenAPI.Processor). This either means you forgot to add the "@impl true" annotation before the definition or that you are accidentally overriding this callback
    │
  2 │   use OpenAPI.Processor
    │   ~~~~~~~~~~~~~~~~~~~~~
    │
    └─ {REDACTED}/generator/processor.ex:2: {REDACTED}.Generator.Processor (module)

Adding the @impl attributes to the default implementations gets rid of the warnings.

P.S. Sorry for the commit mess - was trying to build on top of my nested schema references branch

@aj-foster aj-foster merged commit ba8f0ba into aj-foster:main Jun 24, 2024
1 of 3 checks passed
@aj-foster
Copy link
Owner

Thanks! This may cause some issues with folks who implement their own processors or renderers without @impl attributes, but the compiler warnings should be clear enough to help in that situation.

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.

2 participants