PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.98k stars 1.57k forks source link

OpenAPI specification file provided does not work with latest openapi-generator-cli tool #10831

Open ktam-rel opened 1 year ago

ktam-rel commented 1 year ago

First check

Describe the issue

I downloaded the OpenAPI spec from https://api.prefect.cloud/api/openapi.json and ran the latest version of openapi-generator-cli against it in order to generate a client. The version of openapi-generator-cli I used was the latest stable release 7.0.1.

I ran into issues getting a client to generate and had to make the following changes in order to get that to work successfully

  1. Changed openapi version in the spec file to 3.0.3

  2. After doing this, the following validation errors came up

        - attribute components.schemas.EventRelatedFilter.items is not of type `object`
        - paths.'/api/accounts/{account_id}/workspaces/{workspace_id}/health'. Declared path
          parameter account_id needs to be defined as a path parameter in path or operation level
        - paths.'/api/accounts/{account_id}/workspaces/{workspace_id}/health'. Declared path
          parameter workspace_id needs to be defined as a path parameter in path or operation level
        - attribute components.schemas.EventRelatedFilter.items is missing
  3. I deleted paths and schema attributes related to the above because I didn't really need to hit those related endpoints.

Some of these issues probably stem from the fact that openapi-generator-cli doesn't seem to play nicely with OpenAPI 3.1.0 as of now. But there does appear to be syntactical errors with the /api/accounts/{account_id}/workspaces/{workspace_id}/health path and the EventRelatedFilter schema.

Describe the proposed change

Additional context

No response

desertaxle commented 1 year ago

Thanks for the issue @ktam-rel! Would you mind sharing your reasons for generating a client for the Prefect API with openapi-generator-cli? We have an API client as part of our package that we recommend using if you want to interact directly with the Prefect API.

ktam-rel commented 1 year ago

Hey there, thanks for checking in. We are in the process of building out a process in C# that we want to interact with Prefect. So that’s what we were trying to do using the OpenAPI spec.