netlify / netlify/open-api

Wrong response schema for createSite when there is an error

Open
#377 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
323
Forks
133
Avg merge
2d 8h
Merged PRs (30d)
2

Description

When you read the documentation of createSite

When there is an error, the response schema is

{ message: string, code: integer<int64> }

but it's not the case because we get this JSON message:

{
    "errors": {
        "subdomain": ["must be unique"]
    }
}

Also, the status code is 422, it's not documented.

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 with the createSite operation in the linked OpenAPI documentation and compare its documented error response with the reported JSON containing errors.subdomain. Verify how the 422 status is represented in the specification; the work is done when the schema and status documentation match the reported error response.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.