Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Enums in the HTTP API aren't rendered correctly in documentation #8024

Closed
SyntaxColoring opened this issue Jun 30, 2021 · 2 comments
Closed
Labels
bug docs protocol-engine Ticket related to the Protocol Engine project and associated HTTP APIs robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).

Comments

@SyntaxColoring
Copy link
Contributor

SyntaxColoring commented Jun 30, 2021

Copied from #8006 (comment)...

There's some weirdness happening to our enums. Here's a snippet from our generated OpenAPI spec:

"SessionCommandSummary": {
    "title": "SessionCommandSummary",
    "required": [
        "id",
        "commandType",
        "status"
    ],
    "type": "object",
    "properties": {
        "id": {
            "title": "Id",
            "type": "string",
            "description": "Unique command identifier."
        },
        "commandType": {
            "title": "Commandtype",
            "anyOf": [
                {
                    "const": "addLabwareDefinition",
                    "type": "string"
                },
                {
                    "const": "aspirate",
                    "type": "string"
                },
...

The anyOf consts looks good, but, on /redoc...

Screen Shot 2021-06-29 at 4 17 46 PM

(This example is from the response of GET {{hostname}}:31950/sessions/{{session_id}}/commands.)

I don't know if this is a /redoc problem or a Pydantic problem or what.

@SyntaxColoring SyntaxColoring added bug docs protocol-engine Ticket related to the Protocol Engine project and associated HTTP APIs labels Jun 30, 2021
@SyntaxColoring
Copy link
Contributor Author

Things to investigate:

  • How other APIs represent enums in OpenAPI
  • Whether using a newer version of Redoc/FastAPI fixes this
  • Whether other documentation generators fix this

@SyntaxColoring SyntaxColoring added the robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). label Jun 30, 2021
@SyntaxColoring
Copy link
Contributor Author

This appears to have been resolved at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug docs protocol-engine Ticket related to the Protocol Engine project and associated HTTP APIs robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).
Projects
None yet
Development

No branches or pull requests

1 participant