Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 28, 2025

Implements support for Redocly's x-enumDescriptions OpenAPI extension to include Django choice labels as descriptions in the generated OpenAPI schema, using the correct mapping format per the specification.

Problem

Django models with choices (TextChoices, IntegerChoices, or tuple choices) were generating OpenAPI schemas without descriptive information about what each enum value represents. This made the generated API documentation less user-friendly.

Solution

Added x-enumDescriptions extension to enum fields in OpenAPI schemas with the correct format:

{
  "properties": {
    "year_in_school": {
      "enum": ["FR", "SO", "JR", "SR", "GR"],
      "type": "string",
      "x-enumDescriptions": {
        "FR": "Freshman",
        "SO": "Sophomore",
        "JR": "Junior", 
        "SR": "Senior",
        "GR": "Graduate"
      }
    }
  }
}

Implementation

  • Created custom EnumWithDescriptions and IntEnumWithDescriptions classes that extend Python's Enum/IntEnum with __get_pydantic_json_schema__ method
  • Modified DjangoFieldHandler.get_pydantic_type() to use these custom enum classes and extract choice labels
  • Ensures the extension uses the correct mapping format (object with value-to-description mapping) rather than an array format

Features

  • TextChoices Support: Extracts labels from Django TextChoices with translation support
  • IntegerChoices Support: Works with Django IntegerChoices
  • Tuple Choices Support: Handles regular tuple-based choices
  • Backward Compatibility: Only adds extension when choices are present
  • Translation Support: Properly handles Django's gettext_lazy translated labels

Fixes #124


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


This change is Reviewable

@trunk-io
Copy link

trunk-io bot commented Jul 28, 2025

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@evolua-app
Copy link

evolua-app bot commented Jul 28, 2025

Welcome @Copilot! 🎉

Great PR! I've analyzed your code changes for:

  • 🔒 Security vulnerabilities
  • ✨ Code quality improvements
  • 🎯 Best practices alignment

Ready to see the full review?
Head over to https://evolua.io to:

  • Create your free account
  • Get detailed insights
  • Unlock automated PR reviews
  • Ensure high-quality code

Let's make your code even better together! 🚀

@korbit-ai
Copy link

korbit-ai bot commented Jul 28, 2025

By default, I don't review pull requests opened by bots. If you would like me to review this pull request anyway, you can request a review via the /korbit-review command in a comment.

@korbit-ai
Copy link

korbit-ai bot commented Jul 28, 2025

I was unable to write a description for this pull request. This could be because I only found files I can't scan.

@bito-code-review
Copy link

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change draft PR review settings here, or contact your Bito workspace admin at jukka.hassinen@gmail.com.

@deepsource-io
Copy link
Contributor

deepsource-io bot commented Jul 28, 2025

Here's the code health analysis summary for commits 5fea0cd..358629f. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 4 occurences introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copilot AI and others added 2 commits July 28, 2025 14:25
Co-authored-by: jhassine <1729905+jhassine@users.noreply.github.com>
This commit fixes the style issues introduced in aeb1288 according to the output
from Ruff Formatter.

Details: #125
@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

"""Test script to understand current enum handling and test x-enumDescriptions."""

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

Choose a reason for hiding this comment

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

Setting the Django settings module directly in the script (os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings') is not flexible and can lead to issues when the script is run in different environments. Recommendation: Consider using environment variables or configuration files to set the Django settings module. This approach would allow the script to adapt more easily to different environments without modifying the code.

Comment on lines 24 to 26
print("Current OpenAPI schema:")
import json
print(json.dumps(schema, indent=2)) No newline at end of file

Choose a reason for hiding this comment

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

The use of print statements for outputting the OpenAPI schema is not ideal for production or automated testing environments as it does not allow for easy redirection or capture of the output. Recommendation: Replace print statements with a logging framework or write the output to a file. This would provide better control over output handling and facilitate integration with other systems or automated tests.

Comment on lines 4 to 7
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
import django
django.setup()

Choose a reason for hiding this comment

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

The script sets the Django environment variables and initializes Django directly within the code. This approach is not flexible and can lead to issues when the script is run in different environments or configurations.

Recommendation: Consider managing environment settings outside of the script, for example, by using environment variables set through a deployment configuration or a .env file. This would make the script more portable and easier to configure across different environments.

from enum import Enum
from typing import Annotated
from pydantic import BaseModel, Field
from pydantic._internal._generate_schema import GetJsonSchemaFunction

Choose a reason for hiding this comment

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

The script imports GetJsonSchemaFunction from pydantic._internal._generate_schema, which is an internal part of Pydantic. Using internal APIs is risky as they can change without warning in new releases of the library, potentially breaking your code.

Recommendation: Avoid using internal APIs if possible. Check if Pydantic provides a public API that offers the functionality you need. If not, consider reaching out to the Pydantic maintainers to discuss making this functionality part of the public API.

@qltysh
Copy link

qltysh bot commented Jul 28, 2025

Diff Coverage: Not applicable. There was no coverage data reported for the files in this diff.

Total Coverage: This PR will increase coverage by 0.52%.

File Coverage Changes
Path File Coverage Δ Indirect
django2pydantic/base.py -1.2
django2pydantic/handlers/base.py 4.3
django2pydantic/handlers/text.py 0.9
django2pydantic/infer.py 95.0
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Comment on lines +9 to +31
django.setup()

from django.db import models
from django.utils.translation import gettext_lazy as _
from tests.utils import get_openapi_schema_from_field


class YearInSchool(models.TextChoices):
FRESHMAN = "FR", _("Freshman")
SOPHOMORE = "SO", _("Sophomore")
JUNIOR = "JR", _("Junior")
SENIOR = "SR", _("Senior")
GRADUATE = "GR", _("Graduate")


# Test current behavior
field = models.CharField(max_length=2, choices=YearInSchool.choices)
schema = get_openapi_schema_from_field(field)

print("Current OpenAPI schema:")
import json

print(json.dumps(schema, indent=2))

Choose a reason for hiding this comment

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

The script lacks error handling, which could lead to unclear failures if any part of the Django setup or schema generation fails. Recommendation: Implement try-except blocks around critical operations like django.setup() and get_openapi_schema_from_field(field). Log the errors or handle them appropriately to provide feedback on what went wrong.

Comment on lines +24 to +31
# Test current behavior
field = models.CharField(max_length=2, choices=YearInSchool.choices)
schema = get_openapi_schema_from_field(field)

print("Current OpenAPI schema:")
import json

print(json.dumps(schema, indent=2))

Choose a reason for hiding this comment

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

The script is used for testing but does not utilize a formal testing framework or assertions to verify the correctness of the output against expected results. Recommendation: Integrate a testing framework such as unittest or pytest and use assertions to validate the OpenAPI schema. This will make the script more robust and useful as a test tool, allowing systematic handling of test failures and successes.

Comment on lines +41 to +43
schema = TestModel.model_json_schema()
print("Test schema with custom __get_pydantic_json_schema__:")
print(json.dumps(schema, indent=2))

Choose a reason for hiding this comment

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

The script lacks error handling around critical operations such as generating the JSON schema and printing it. This could lead to unhandled exceptions if there are issues during these operations.

Recommendation: Implement try-except blocks around the schema generation and JSON serialization to handle potential exceptions gracefully. Provide meaningful error messages to aid in debugging if an error occurs.

) -> JsonSchemaValue:
"""Add custom x-enumDescriptions to the enum schema."""
json_schema = handler(core_schema)
json_schema["x-enumDescriptions"] = ["Choice A", "Choice B", "Choice C"]

Choose a reason for hiding this comment

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

The descriptions for the enum values in TestEnum are hardcoded within the __get_pydantic_json_schema__ method. This approach is not flexible and makes the code less maintainable if the enum values or their descriptions change.

Recommendation: Consider associating descriptions directly with enum members or using a dictionary to map enum values to their descriptions. This would make the code more maintainable and flexible.

@codecov
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.95%. Comparing base (5fea0cd) to head (358629f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
+ Coverage   87.48%   87.95%   +0.46%     
==========================================
  Files          42       43       +1     
  Lines        1998     2017      +19     
  Branches      121      125       +4     
==========================================
+ Hits         1748     1774      +26     
+ Misses        250      243       -7     

see 6 files with indirect coverage changes

@qltysh
Copy link

qltysh bot commented Jul 28, 2025

❌ 23 blocking issues (23 total)

Tool Category Rule Count
ruff Lint print found 4
ruff Lint Missing docstring in public class 3
ruff Lint Shebang is present but file is not executable 2
ruff Lint Import block is un-sorted or un-formatted 2
ruff Lint typing\.Annotated imported but unused 2
ruff Lint Module level import not at top of file 10

@@ -0,0 +1,31 @@
#!/usr/bin/env python3
Copy link

@qltysh qltysh bot Jul 28, 2025

Choose a reason for hiding this comment

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

Shebang is present but file is not executable [ruff:EXE001]

Suggested change
#!/usr/bin/env python3

The shebang line was removed because the file is not executable, which resolves the EXE001 issue identified by the ruff static analysis tool.

Caution: AI-generated change


from django.db import models
from django.utils.translation import gettext_lazy as _
from tests.utils import get_openapi_schema_from_field
Copy link

Choose a reason for hiding this comment

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

Module level import not at top of file [ruff:E402]



# Create a test enum with custom schema modifier
class TestEnum(str, Enum):
Copy link

Choose a reason for hiding this comment

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

Missing docstring in public class [ruff:D101]



schema = TestModel.model_json_schema()
print("Test schema with custom __get_pydantic_json_schema__:")
Copy link

Choose a reason for hiding this comment

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

print found [ruff:T201]


schema = TestModel.model_json_schema()
print("Test schema with custom __get_pydantic_json_schema__:")
print(json.dumps(schema, indent=2))
Copy link

Choose a reason for hiding this comment

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

print found [ruff:T201]

from tests.utils import get_openapi_schema_from_field


class YearInSchool(models.TextChoices):
Copy link

@qltysh qltysh bot Jul 28, 2025

Choose a reason for hiding this comment

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

Missing docstring in public class [ruff:D101]

Suggested change
class YearInSchool(models.TextChoices):

Added a docstring to the YearInSchool class to comply with the D101 rule, which requires a docstring for public classes. The docstring provides a brief description of the class's purpose.

Caution: AI-generated change

Comment on lines +11 to +13
from enum import Enum
from typing import Annotated
from pydantic import BaseModel, Field
Copy link

@qltysh qltysh bot Jul 28, 2025

Choose a reason for hiding this comment

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

Found 2 issues:

1. Module level import not at top of file [ruff:E402]


2. pydantic.Field imported but unused [ruff:F401]

Suggested change
from enum import Enum
from typing import Annotated
from pydantic import BaseModel, Field
from typing import Annotated
from enum import Enum

The import statement for the 'enum' module was moved to the top of the file to comply with the E402 rule, which requires all module-level imports to be at the top of the file.

Caution: AI-generated change

@bito-code-review
Copy link

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change draft PR review settings here, or contact your Bito workspace admin at jukka.hassinen@gmail.com.

Copy link
Collaborator

@jhassine jhassine left a comment

Choose a reason for hiding this comment

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

@copilot did you check the the linked specs as you did not seem to follow the correct structure as indicated in this example: https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-enum-descriptions#examples

The following example shows a schema with two short-named options, and the x-enumDescriptions entry to list all enum entries and give additional context for each:

components:
  schemas:
    TicketType:
      description: Type of ticket being purchased. Use `general` for regular museum entry and `event` for tickets to special events.
      type: string
      enum:
        - event
        - general
      x-enumDescriptions:
        event: Event Tickets _(timed entry)_
        general: General Admission
      example: event

Copilot AI and others added 2 commits August 1, 2025 08:41
Co-authored-by: jhassine <1729905+jhassine@users.noreply.github.com>
This commit fixes the style issues introduced in 3a18e2b according to the output
from Ruff Formatter.

Details: #125
Comment on lines +6 to +9
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
import django

django.setup()

Choose a reason for hiding this comment

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

The script sets the Django environment variables and initializes Django directly within the code. This approach is not flexible and can lead to issues when the script is run in different environments or configurations.

Recommendation: Consider managing environment settings outside of the script, for example, by using environment variables set through a deployment configuration or a .env file. This would make the script more portable and easier to configure across different environments.

Comment on lines +44 to +46
schema = TestModel.model_json_schema()
print("Test schema with custom __get_pydantic_json_schema__:")
print(json.dumps(schema, indent=2))

Choose a reason for hiding this comment

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

The script lacks error handling around critical operations such as generating the JSON schema and printing it. This could lead to unhandled exceptions if there are issues during these operations.

Recommendation: Implement try-except blocks around the schema generation and JSON serialization to handle potential exceptions gracefully. Provide meaningful error messages to aid in debugging if an error occurs.

Comment on lines +25 to +36
@classmethod
def __get_pydantic_json_schema__(
cls, core_schema: core_schema.CoreSchema, handler: GenerateJsonSchema
) -> JsonSchemaValue:
"""Add custom x-enumDescriptions to the enum schema."""
json_schema = handler(core_schema)
json_schema["x-enumDescriptions"] = {
"a": "Choice A",
"b": "Choice B",
"c": "Choice C",
}
return json_schema

Choose a reason for hiding this comment

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

Potential Data Race and Modularity Concerns

The method __get_pydantic_json_schema__ modifies the json_schema dictionary directly. This approach can lead to data races if multiple threads are attempting to modify the schema simultaneously. Additionally, the method is modifying the schema in a way that is tightly coupled to the specific enum class.

Recommendation:

  • To avoid data races, consider using thread-safe mechanisms or deep copying the schema before modification.
  • Increase modularity by separating the concerns: create a dedicated function or class responsible for schema modifications, which can be reused across different parts of the application or for different enums.

Comment on lines +6 to +8
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
import django

Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. Module level import not at top of file [ruff:E402]


2. Import block is un-sorted or un-formatted [ruff:I001]

Suggested change
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
import django
from django.db import models
from django.utils.translation import gettext_lazy as _
from tests.utils import get_openapi_schema_from_field

The imports from Django and the test utilities were moved to the top of the file to comply with the E402 rule, which requires module-level imports to be at the top of the file. This change ensures that all imports are declared before any other code execution, such as setting environment variables or calling setup functions.

Caution: AI-generated change

Comment on lines +11 to +12
from django.db import models
from django.utils.translation import gettext_lazy as _
Copy link

Choose a reason for hiding this comment

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

Module level import not at top of file [ruff:E402]

Suggested change
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.db import models

The import statement for gettext_lazy was moved to the top of the file to comply with PEP 8 guidelines, which require all import statements to be at the top of the file. This resolves the E402 error reported by the ruff static analysis tool.

Caution: AI-generated change

Comment on lines +6 to +12
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
import django

django.setup()

from enum import Enum
from typing import Annotated
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. Module level import not at top of file [ruff:E402]


2. Import block is un-sorted or un-formatted [ruff:I001]

Suggested change
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
import django
django.setup()
from enum import Enum
from typing import Annotated
from enum import Enum
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
import django
django.setup()

The import statement for the Enum module was moved to the top of the file to comply with the E402 rule, which requires all module-level imports to be at the top of the file.

Caution: AI-generated change

Comment on lines +12 to +13
from typing import Annotated
from pydantic import BaseModel, Field
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. Module level import not at top of file [ruff:E402]


2. typing.Annotated imported but unused [ruff:F401]

Suggested change
from typing import Annotated
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field
from typing import Annotated

The import statement for Annotated from the typing module was moved to the top of the file to comply with the E402 rule, which requires all module-level imports to be at the top of the file.

Caution: AI-generated change

Comment on lines +11 to +14
from enum import Enum
from typing import Annotated
from pydantic import BaseModel, Field
from pydantic.json_schema import JsonSchemaValue, GenerateJsonSchema
Copy link

Choose a reason for hiding this comment

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

Module level import not at top of file [ruff:E402]

Suggested change
from enum import Enum
from typing import Annotated
from pydantic import BaseModel, Field
from pydantic.json_schema import JsonSchemaValue, GenerateJsonSchema
from pydantic.json_schema import JsonSchemaValue, GenerateJsonSchema
from enum import Enum
from typing import Annotated
from pydantic import BaseModel, Field

The import statement for JsonSchemaValue and GenerateJsonSchema from pydantic.json_schema was moved to the top of the file to comply with the E402 rule, which requires all module-level imports to be at the top of the file.

Caution: AI-generated change

from typing import Annotated
from pydantic import BaseModel, Field
from pydantic.json_schema import JsonSchemaValue, GenerateJsonSchema
from pydantic_core import core_schema
Copy link

Choose a reason for hiding this comment

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

Module level import not at top of file [ruff:E402]

from pydantic import BaseModel, Field
from pydantic.json_schema import JsonSchemaValue, GenerateJsonSchema
from pydantic_core import core_schema
import json
Copy link

Choose a reason for hiding this comment

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

Module level import not at top of file [ruff:E402]



# Test how to add custom schema properties
class TestModel(BaseModel):
Copy link

Choose a reason for hiding this comment

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

Missing docstring in public class [ruff:D101]

Copy link
Contributor Author

Copilot AI commented Aug 1, 2025

@copilot did you check the the linked specs as you did not seem to follow the correct structure as indicated in this example: https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-enum-...

You're absolutely right! I've now implemented the correct format per the Redocly specification. The x-enumDescriptions now uses a mapping format where keys are enum values and values are descriptions, instead of the incorrect array format I had initially.

Before (incorrect):

"x-enumDescriptions": ["Freshman", "Sophomore", "Junior", "Senior", "Graduate"]

After (correct per Redocly spec):

"x-enumDescriptions": {
  "FR": "Freshman",
  "SO": "Sophomore", 
  "JR": "Junior",
  "SR": "Senior",
  "GR": "Graduate"
}

The implementation now properly follows the Redocly example you provided and works with all Django choice types (TextChoices, IntegerChoices, and tuple choices). Fixed in commit b4e039e.

Copilot AI changed the title [WIP] Support redocly's x-enumDescriptions OpenAPI extension Support Redocly's x-enumDescriptions OpenAPI extension with correct mapping format Aug 1, 2025
Copilot AI requested a review from jhassine August 1, 2025 08:49
Copilot finished work on behalf of jhassine August 1, 2025 08:49
@trunk-io
Copy link

trunk-io bot commented Aug 1, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@bito-code-review
Copy link

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change draft PR review settings here, or contact your Bito workspace admin at jukka.hassinen@gmail.com.

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.

Support redocly's x-enumDescriptions OpenAPI extension

2 participants