Skip to content

Use constants from net/http for the status codes #2397

@Pe-te

Description

@Pe-te

When generating the api.gen.go, we only see one constant from the net/http package:

w.WriteHeader(http.StatusNotImplemented)

All other places it just uses the raw status code integer value from the spec:

w.WriteHeader(504)

Would be helpful to get a readable constant name instead of the integer,
especially when you use more than the typical 200 and 404 status codes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions