openai / openai/openai-openapi

Incorrect status code for some endpoints

Open Beginner friendly
#407 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug specification
Dominant language
No language data
Stars
2.5k
Forks
527
Avg merge
1h 46m
Merged PRs (30d)
2

Description

I am the developer of terraform-provider-openai. This library uses the OpenAPI specification to generate its Go API client.

I noticed that some endpoints were incorrectly tagged as HTTP 200 instead of HTTP 201:

  • POST /organization/invites
  • POST /organization/projects
  • POST /organization/projects/{project_id}/users
  • POST /organization/projects/{project_id}/service_accounts

Additionally, the type property in the request body for POST /organization/admin_api_keys should be a string instead of an object.

There is also an issue with using $allOf for nullable values, but this has been reported in https://github.com/openai/openai-openapi/issues/391.

To address these issues, I applied post-processing to fix the API YAML file before generating the Go API client:

https://github.com/jianyuan/terraform-provider-openai/blob/main/internal/apiclient/api-patches.yaml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the referenced internal/apiclient/api-patches.yaml, then locate the corresponding OpenAPI YAML definitions for the listed endpoints. Done means those four POST operations return 201, the admin API key request's type property is a string, and the unrelated nullable-value issue remains out of scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.