-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapicurio.http
More file actions
34 lines (28 loc) · 4.42 KB
/
apicurio.http
File metadata and controls
34 lines (28 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Apucurio
@baseUrl=http://localhost:5020/apis/registry/v3
### Search artifacts
GET {{baseUrl}}/groups/default/artifacts
### Create contract
POST {{baseUrl}}/groups/default/artifacts
content-type: application/json
{
"artifactId": "books",
"artifactType": "OPENAPI",
"name": "Books",
"description": "Manage books in the library.",
"firstVersion": {
"version": "1.0",
"content": {
"content": "{\"openapi\":\"3.0.4\",\"info\":{\"version\":\"1.0\",\"title\":\"Books\",\"description\":\"Manage books in the library.\",\"contact\":{\"name\":\"Anton Hrytsenko\"}},\"tags\":[{\"name\":\"Books\"}],\"servers\":[{\"url\":\"http://localhost:3020/v1/\",\"description\":\"Mockoon\"},{\"url\":\"http://localhost:4020\",\"description\":\"Prism\"}],\"security\":[{\"bearerAuth\":[]}],\"paths\":{\"/books\":{\"get\":{\"operationId\":\"findBooks\",\"summary\":\"Find books\",\"description\":\"Search books in the library.\",\"tags\":[\"Books\"],\"parameters\":[{\"in\":\"query\",\"name\":\"tags\",\"description\":\"A list of tags to filter by.\",\"schema\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}],\"responses\":{\"200\":{\"description\":\"Search was completed.\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"books\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/components/schemas/Book\"}}}}}}},\"400\":{\"$ref\":\"#/components/responses/BadRequest\"},\"default\":{\"$ref\":\"#/components/responses/UnexpectedError\"}}},\"post\":{\"operationId\":\"addBook\",\"summary\":\"Add book\",\"description\":\"Add a new book to the library.\",\"tags\":[\"Books\"],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Book\"}}}},\"responses\":{\"201\":{\"description\":\"Book was created.\",\"headers\":{\"Location\":{\"schema\":{\"type\":\"string\"},\"description\":\"Link to a new book.\"}}},\"400\":{\"$ref\":\"#/components/responses/BadRequest\"},\"default\":{\"$ref\":\"#/components/responses/UnexpectedError\"}}}},\"/books/{bookId}\":{\"parameters\":[{\"$ref\":\"#/components/parameters/bookIdParam\"}],\"put\":{\"operationId\":\"updateBook\",\"summary\":\"Update book\",\"description\":\"Update an existing book in the library.\",\"tags\":[\"Books\"],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Book\"}}}},\"responses\":{\"204\":{\"description\":\"Book was updated.\"},\"400\":{\"$ref\":\"#/components/responses/BadRequest\"},\"default\":{\"$ref\":\"#/components/responses/UnexpectedError\"}}},\"delete\":{\"operationId\":\"deleteBook\",\"summary\":\"Delete book\",\"description\":\"Delete an existing book from the library.\",\"tags\":[\"Books\"],\"responses\":{\"204\":{\"description\":\"Book was deleted.\"},\"400\":{\"$ref\":\"#/components/responses/BadRequest\"},\"default\":{\"$ref\":\"#/components/responses/UnexpectedError\"}}}}},\"components\":{\"securitySchemes\":{\"bearerAuth\":{\"type\":\"http\",\"scheme\":\"bearer\"}},\"parameters\":{\"bookIdParam\":{\"in\":\"path\",\"name\":\"bookId\",\"description\":\"An internal book identifier.\",\"required\":true,\"schema\":{\"type\":\"string\"}}},\"schemas\":{\"Book\":{\"description\":\"A regular book.\",\"type\":\"object\",\"properties\":{\"book\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\",\"readOnly\":true},\"isbn\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"},\"authors\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"publisher\":{\"type\":\"string\"},\"published\":{\"type\":\"string\"},\"format\":{\"type\":\"string\"},\"pages\":{\"type\":\"integer\"},\"tags\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"id\",\"isbn\",\"title\"]}}},\"Error\":{\"description\":\"A generic error.\",\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\"},\"message\":{\"type\":\"string\"}},\"required\":[\"code\",\"message\"]}},\"responses\":{\"BadRequest\":{\"description\":\"Bad request.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Error\"}}}},\"UnexpectedError\":{\"description\":\"Server error.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/Error\"}}}}}}}",
"contentType": "application/json"
}
}
}
### Allow deletion
PUT {{baseUrl}}/admin/config/properties/apicurio.rest.deletion.artifact.enabled
content-type: application/json
{
"value": "true"
}
### Delete contract
DELETE {{baseUrl}}/groups/default/artifacts/books