Skip to content

Actions openapi spec POST / PATCH / DELETE freeze #9817

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

Closed
MichalNemec opened this issue Aug 7, 2023 · 5 comments
Closed

Actions openapi spec POST / PATCH / DELETE freeze #9817

MichalNemec opened this issue Aug 7, 2023 · 5 comments
Labels
actions/open-API Issues related to open api import feature k/bug Something isn't working t/gql-services

Comments

@MichalNemec
Copy link

MichalNemec commented Aug 7, 2023

Version Information

Server Version: v2.31.0
CLI Version (for CLI related issue): v2.31.0

Environment

Self hosted linux

What is the current behaviour?

Whenever i click create, the whole console freezes.
EDIT: some of endpoints say Maximum call stack size exceeded

What is the expected behaviour?

to not freeze and add the endpoint correctly.

Screenshots

image

How to reproduce the issue?

  1. Create json openapi with post/patch/delete
  2. Click create
  3. see freeze
"/api/alert/manager/set-record-state": {
      "post": {
        "tags": [
          "Alert"
        ],
        "summary": "Lock/unlock alert",
        "description": "Possible responses:\r\n - 200 OK: int\r\n - 401 Unauthorized\r\n - 403 Insufficient role\r\n - 500 Internal Server Error: An unexpected error occurred. (default response)",
        "parameters": [
          {
            "name": "alertId",
            "in": "query",
            "description": "",
            "required": true,
            "style": "form",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Lock, Unlock",
            "required": true,
            "style": "form",
            "schema": {
              "$ref": "#/components/schemas/RecordEditState"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDTO"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDTO"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "openid",
              "profile",
              "email",
              "phone",
              "address",
              "offline_access"
            ]
          }
        ]
      }
    },

Please provide any traces or logs that could help here.

no log whatsoever, docker logs -f <CONT_ID> says only v1 metadata and healtz

Any possible solutions/workarounds you're aware of?

not really.

Keywords

actions freeze post delete patch

@MichalNemec MichalNemec added the k/bug Something isn't working label Aug 7, 2023
@soorajshankar soorajshankar added the actions/open-API Issues related to open api import feature label Aug 14, 2023
@tirumaraiselvan
Copy link
Contributor

Thanks for reporting with the openAPI schema. We are looking into it.

@Varun-Choudhary
Copy link
Contributor

Varun-Choudhary commented Sep 4, 2023

Hello @MichalNemec
We are currently facing an issue while trying to import the OpenAPI file. With the given example, we are not able to import the spec as the reference parts are missing. To assist us in resolving this issue effectively, it would greatly benefit us if you could share the complete API specification with us.
If you are not comfortable sharing the full API specification on this public platform, please feel free to email it to me at my official email address: [email protected]. Your cooperation in this matter is greatly appreciated.
Thank you!

@MichalNemec
Copy link
Author

Hello @Varun-Choudhary
I just realized, that the backend models point to everything, which can trigger cyclic dependency. I Changed it to simple DTOs and it works properly. If you still need the spec, i can share it.

@Varun-Choudhary
Copy link
Contributor

Varun-Choudhary commented Sep 5, 2023

Hey @MichalNemec, still I'm facing issues with importing the OpenAPI spec, could also validate it here . It'll be good if you can share the complete spec with me.

@soorajshankar
Copy link
Member

Hey @MichalNemec,

I Changed it to simple DTOs and it works properly.

Glad that you were able to find a solution here, looks like the issue was caused by an OpenAPI spec which had a cyclic dependency- though it is possible (from JSON schema PoV) to define cyclic dependency, it won't be able to generate any schema out of it and hence is considered invalid.

If you are interested to know more, there is a related discussion here in the OAS official repo and I think from Hasura side, we can probably add an additional error check to identify the circular dependency and throw a better error for clarity- however the actual fix would still be needed to be done on the OpenAPI schema.

Closing this issue now - considering the issue is with the OAS file, feel free to re-open if you still face issue on the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions/open-API Issues related to open api import feature k/bug Something isn't working t/gql-services
Projects
None yet
Development

No branches or pull requests

5 participants