[#40397] OpenAPI Specs not OpenAPI 3.0 compatible
- https://community.openproject.org/work_packages/40397 - fixed crucial bugs and most warnings - fixed spelling and namingpull/10025/head
parent
9cae91faba
commit
e19ecc27cf
@ -1,14 +1,14 @@ |
||||
# API Version 3 |
||||
|
||||
|
||||
_Status: under development_ |
||||
|
||||
|
||||
The documentation for APIv3 is written according to the [OpenAPI 3.0 Specification](https://swagger.io/specification/). |
||||
|
||||
The file in the repository is split up into many files. Some OAS (OpenAPI Specification) do not support that. |
||||
You can retrieve the complete, singular file from any OpenProject server under `/api/v3/spec.json` or `/api/v3/spec.yml`. |
||||
Additionally, there is a rake task that outputs the specification as a whole as well, either as json or yaml depending |
||||
on the given output file name: |
||||
|
||||
The file in the repository is split up into many files. Some OAS (OpenAPI Specification) do not support that. You can |
||||
retrieve the complete, singular file from any OpenProject server under `/api/v3/spec.json` or `/api/v3/spec.yml`. |
||||
Additionally, there is a script that outputs the specification as a whole as well, either as json or yaml depending on |
||||
the given format argument: |
||||
|
||||
``` |
||||
bundle exec rake api:save_spec ./openproject-oas.yml |
||||
./script/api/spec --format yaml > openproject-oas.yml |
||||
``` |
||||
|
@ -0,0 +1,26 @@ |
||||
# Schema: error response |
||||
--- |
||||
type: object |
||||
required: |
||||
- _type |
||||
- errorIdentifier |
||||
- message |
||||
properties: |
||||
_embedded: |
||||
type: object |
||||
properties: |
||||
details: |
||||
type: object |
||||
properties: |
||||
attribute: |
||||
type: string |
||||
example: project |
||||
_type: |
||||
type: string |
||||
enum: [ 'Error' ] |
||||
errorIdentifier: |
||||
type: string |
||||
example: urn:openproject-org:api:v3:errors:PropertyConstraintViolation |
||||
message: |
||||
type: string |
||||
example: Project can't be blank. |
@ -1,95 +0,0 @@ |
||||
# /api/v3/views/{identifier} |
||||
--- |
||||
|
||||
post: |
||||
requestBody: |
||||
content: |
||||
application/json: |
||||
examples: |
||||
'Views::WorkPackagesTable': |
||||
value: |
||||
_links: |
||||
query: |
||||
href: /api/v3/queries/5 |
||||
'Views::TeamPlanner': |
||||
value: |
||||
_links: |
||||
query: |
||||
href: /api/v3/queries/5 |
||||
schema: |
||||
type: object |
||||
properties: |
||||
_links: |
||||
type: object |
||||
properties: |
||||
query: |
||||
type: object |
||||
properties: |
||||
href: |
||||
type: href |
||||
responses: |
||||
'201': |
||||
content: |
||||
application/hal+json: |
||||
examples: |
||||
'Views::WorkPackagesTable': |
||||
"$ref": "../components/examples/view_work_packages_table.yml" |
||||
'Views::TeamPlanner': |
||||
"$ref": "../components/examples/view_team_planner.yml" |
||||
description: Created |
||||
headers: {} |
||||
'400': |
||||
content: |
||||
application/hal+json: |
||||
examples: |
||||
response: |
||||
value: |
||||
_type: Error |
||||
errorIdentifier: urn:openproject-org:api:v3:errors:InvalidRequestBody |
||||
message: The request body was not a single JSON object. |
||||
description: Occurs when the client did not send a valid JSON object in the |
||||
request body. |
||||
headers: {} |
||||
'422': |
||||
content: |
||||
application/hal+json: |
||||
examples: |
||||
response: |
||||
value: |
||||
_embedded: |
||||
details: |
||||
attribute: query |
||||
_type: Error |
||||
errorIdentifier: urn:openproject-org:api:v3:errors:PropertyConstraintViolation |
||||
message: "Query does not exist." |
||||
description: |- |
||||
Returned if: |
||||
|
||||
* the client tries to modify a read-only property (`PropertyIsReadOnly`) |
||||
|
||||
* a constraint for a property was violated (`PropertyConstraintViolation`) |
||||
|
||||
* the client provides a link to an invalid resource (`ResourceTypeMismatch`), |
||||
e.g. a query not found |
||||
headers: {} |
||||
tags: |
||||
- Views |
||||
description: |- |
||||
When calling this endpoint the client provides a single object, containing at least the properties and links that are required, in the body. |
||||
The required fields of a View can be found in its schema, which is embedded in the respective form. |
||||
Note that it is only allowed to provide properties or links supporting the write operation. |
||||
|
||||
There are different subtypes of `Views` (e.g. `Views::WorkPackagesTable`) with each having its own |
||||
endpoint for creating that subtype e.g. |
||||
|
||||
* `/api/v3/views/work_packages_table` for `Views::WorkPackagesTable` |
||||
* `/api/v3/views/team_planner` for `Views::TeamPlanner` |
||||
* `/api/v3/views/work_packages_calendar` for `Views::WorkPackagesCalendar` |
||||
|
||||
**Not yet implemented** To get the list of available subtypes and by that the endpoints for creating a subtype, use the |
||||
``` |
||||
/api/v3/views/schemas |
||||
``` |
||||
endpoint. |
||||
operationId: Create_views |
||||
summary: Create view |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue