Skip to content

[Bug]: @doc on bytes doesn't output OpenAPI description #3457

Closed
@maxbeatty

Description

@maxbeatty

Describe the bug

If a @doc decorator is used on a bytes field, the resulting OpenAPI spec does not include a description for that field.

model UploadParameters {
  @doc("A `.zip` archive file.") 
  file: bytes,
}
components:
  schemas:
    UploadParametersMultiPart:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          format: binary

If file is changed to string, then a description appears as expected:

model UploadParameters {
  @doc("A `.zip` archive file.") 
  file: string,
}
components:
  schemas:
    UploadParametersMultiPart:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          description: A `.zip` archive file.

Other types like int16, duration, and unknown also work as expected.

Reproduction

Playground

Checklist

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions