Edge cases
Edit on GitHubOne endpoint that uses every part of OpenAPI the components render.
This page renders a test spec, edge-cases.yaml. It isn't a real API. Its one endpoint puts every case in one place, so you can check how the components handle each one:
- parameters in the path, query, header and cookie, with enums, limits, defaults, a deprecated parameter and an array sent as
a,b, - three ways to authenticate (a bearer token, an API key plus OAuth scopes, or none),
- a body in JSON, multipart and URL-encoded form,
allOf,oneOfwith a discriminator,anyOfwithnull, a schema that contains itself, maps, read-only, write-only and deprecated fields,- 2xx, 3xx, 4xx, a
5XXrange and adefaultresponse, some with headers, - Markdown in the description, including a
javascript:link that has to render as plain text, - a server URL with variables.
The endpoint
Items
Create an item
https://eu.api.example.com/v2/projects/{project_id}/itemsCreates an item in a project. The request can be JSON, a multipart upload or a URL-encoded form.
Things to know
- Items are validated before they are saved.
- A request with the same
Idempotency-Keyreturns the first result. - Large uploads return
202and finish in the background.
{ "kind": "note", "title": "Hello" }Read the guide. This link is unsafe and must render as text.
Authorization
AuthorizationheaderrequiredBearer authentication (JWT): Bearer <token>.
or
X-API-KeyheaderrequiredAPI key (apiKey).
AuthorizationheaderrequiredOAuth 2.0 access token (oauth): Bearer <token>.
Scopes: items:writeitems:read
The project to add the item to.
"^prj_[a-z0-9]{12}$"Example: prj_8f2k1m9x0a3b
3Range: >= 1, <= 5Old behavior. Will be removed in v3.
The item to create.
titlestringrequiredtagsstring[]contentNote | TaskEither a note or a task.
ownerobject | nullWho owns the item. null means the project.
visibilitystring"private"One of: "private""team""public"scorenumbermetadataobjectAny extra string values.
outlineNodeA tree node. Children are nodes too.
secretstring<password>write-onlyNever returned in responses.
colorstringdeprecatedUse visibility instead.
The item was created.
The upload was accepted and is processed in the background.
Nothing was saved because dry_run was true.
An item with this idempotency key already exists.
A problem with the request.
Missing or invalid credentials.
An item with this title already exists in the project.
The item failed validation.
Too many requests.
Something went wrong on our side.
A problem with the request.
curl -X POST 'https://eu.api.example.com/v2/projects/prj_8f2k1m9x0a3b/items?dry_run=false&fields=id%2Ctitle&priority=3' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"kind": "note",
"title": "Shopping list",
"body": "Milk, eggs",
"tags": [
"home"
]
}'{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "string",
"tags": [
"string"
],
"content": {
"kind": "note",
"body": "string"
},
"owner": {
"user_id": "string",
"email": "user@example.com"
},
"visibility": "private",
"score": 1,
"metadata": {},
"outline": {
"label": "string",
"children": [
null
]
},
"color": "string",
"created_at": "2024-01-01T00:00:00Z"
}Schemas
The request body:
titlestringrequiredtagsstring[]contentNote | TaskEither a note or a task.
ownerobject | nullWho owns the item. null means the project.
visibilitystring"private"One of: "private""team""public"scorenumbermetadataobjectAny extra string values.
outlineNodeA tree node. Children are nodes too.
secretstring<password>write-onlyNever returned in responses.
colorstringdeprecatedUse visibility instead.
The error format:
typestring<uri>requiredtitlestringrequiredstatusintegerdetailstring | nullThe API overview
Ariadocs edge cases
A test fixture, not a real API.
One endpoint that uses every part of OpenAPI the @ariadocs/components package renders. Use it to check how the components handle unusual specs.
https://eu.api.example.com/v2Regional API
Server variables are filled in with their defaults.
AuthorizationheaderrequiredBearer authentication (JWT): Bearer <token>.