Skip to content

Conversation

@voetberg
Copy link
Contributor

@voetberg voetberg commented Nov 20, 2025

#587

Creates a schema section of the api spec with all the enumerate constants in the database. e.g.:

components:
  securitySchemes:
    ...
  schemas:
    AccountStatus:
      type: string
      enum:
      - ACTIVE
      - SUSPENDED
      - DELETED
    AccountType:
      type: string
      enum:
      - USER
      - GROUP
      - SERVICE
    ...

These can then be used in docstrings like so:

...
obj: 
   description: A given object
   $ref: "#/components/schemas/MatchingEnumerateObject"
...

@voetberg voetberg force-pushed the 587-render_enum_types branch 2 times, most recently from d1fb26e to 0436bfb Compare November 20, 2025 16:23
@voetberg voetberg marked this pull request as ready for review November 20, 2025 17:41
@voetberg voetberg linked an issue Nov 20, 2025 that may be closed by this pull request
@Geogouz Geogouz self-requested a review November 25, 2025 21:36
Comment on lines 113 to 116
object1:
description: "..."
$ref: '#/components/schemas/Object1'
object2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fix the indentation across the objects? Right now it is not even.

@Geogouz
Copy link
Contributor

Geogouz commented Nov 25, 2025

Could you also rebase please?

@voetberg voetberg force-pushed the 587-render_enum_types branch 2 times, most recently from 09e868b to e728827 Compare December 1, 2025 20:19
@voetberg voetberg force-pushed the 587-render_enum_types branch from e728827 to be8886c Compare December 2, 2025 15:12
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.

API: rendering Enums in docstrings

3 participants