aj-foster / open-api-generator

Open API code generator for Elixir
MIT License
97 stars 13 forks source link

Mark behaviour callback implementations with @impl attribute #51

Closed McSym28 closed 2 months ago

McSym28 commented 3 months ago

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 commented 2 months ago

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.