Skip to content

Refit should emit diagnostics for invalid interfaces #1885

Open
@TimothyMakkison

Description

Refit should emit diagnostic warnings and errors for invalid methods and interfaces. Many exceptions in RequestBuilderImplementation could be statically determined via a source generator.

  • Invalid url backslash
  • Multiple CancellationToken params
  • HeadersCollection must be IDictionary

Severity to be determined layer.

More advanced checks may to read the attribute values. It isn't required but I'd prefer to reference ../Refit.csproj and construct each attribute in the source generator. I don't know if this could cause issues 🤔

Would this be considered to be a breaking change? It may prevent users from building code that previously ran, although it was likely invalid.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions