Tomas Cohen Arazi
f1dca080d4
This patch starts the work of curating the spec documentation-related aspects. It doesn't involve any functional change on the API, just labels (used to render docs) and some descriptions basis is added. - A top level 'tags' entry is added to swagger.yaml. - The 'name' attribute is left with double quotes. This is on purpose, to differentiate from 'x-displayName' which is the actual text to be displayer and should be handled by documentation folks, not us, devs :-D - I add a very limited 'description' attribute there. It is the top level description of the section. For example the description for the 'Biblios' section is 'Manage bibliographic records'. As it expects Markdown, anything we want can be added there. - Some labels have been tweaked in paths, to rollback the decision of making the labels in paths more end-user friendly. We don't want them to be typed much, and I picked what we use the most: snake_case. - The order in which things are displayed, is the one we specified on the swagger.yaml file. The 'batch import profiles' one is left at the bottom on purpose. But this is subject to discussion. As a general rule, I put them all in alphabetical order (on the x-displayName label I mean). I submit early before family duties so others can pick where I left in the morning. So: TODO: - I'm not sure what's best for Advanced editor macros. My bet is we should define a 'Macros' label, and use a summary on the routes themselves to specify this are not just 'macros', but advanced editor macros. Look at the return claims paths to understand how I propose to use the 'summary' attribtue. - I understand how we use 'rotas', but someone more familiar with the terminology,... please... step in. - Related to the first item here, we need to add summary to all routes, so ReDoc doesn't display the operationId anymore. Again, I put an example in Return claims that we can follow. To test: 1. Have KTD running 2. Open your browser at: http://localhost:/8080/api/v1/ 3. Save the page as spec.json in some known dir 4. Go to that dir and run: $ docker run -it --rm -p 8083:80 \ -v $(pwd)/spec.json:/usr/share/nginx/html/swagger.json \ -e SPEC_URL=swagger.json redocly/redoc 5. Open your browser at http://localhost:8083 => SUCCESS: You see the docs 6. Look at the list of 'categories' on the left => FAIL: They look a bit weird 7. Apply this patch 8. Ctrl+c on the terminal running docker 9. Reload plack 10. Repeat 2 through 6 => SUCCESS: Wow, things look better! 11. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
113 lines
2.6 KiB
YAML
113 lines
2.6 KiB
YAML
---
|
|
swagger: 2.0
|
|
basePath: /api/v1
|
|
paths:
|
|
$ref: paths.json
|
|
definitions:
|
|
$ref: definitions.json
|
|
parameters:
|
|
$ref: parameters.json
|
|
x-primitives:
|
|
$ref: x-primitives.json
|
|
info:
|
|
title: Koha REST API
|
|
version: "1"
|
|
license:
|
|
name: GPL v3,
|
|
url: http://www.gnu.org/licenses/gpl.txt
|
|
contact:
|
|
name: Koha Development Team
|
|
url: https://koha-community.org/
|
|
description: |
|
|
## Introduction
|
|
|
|
This API is documented in **OpenAPI format**.
|
|
|
|
## Special headers
|
|
|
|
### x-koha-library
|
|
|
|
This optional header should be passed to give your api request a library
|
|
context; If it is not included in the request, then the request context
|
|
will default to using your api comsumer's assigned home library.
|
|
tags:
|
|
- name: "biblios"
|
|
x-displayName: Biblios
|
|
description: |
|
|
Manage bibliographic records
|
|
- name: "cashups"
|
|
x-displayName: Cashups
|
|
description: |
|
|
Manage cash register cashups
|
|
- name: "checkouts"
|
|
x-displayName: Checkouts
|
|
description: |
|
|
Manage checkouts
|
|
- name: "cities"
|
|
x-displayName: Cities
|
|
description: |
|
|
Manage cities
|
|
- name: "clubs"
|
|
x-displayName: Clubs
|
|
description: |
|
|
Manage patron clubs
|
|
- name: "funds"
|
|
x-displayName: Funds
|
|
description: |
|
|
Manage funds for the acquisitions module
|
|
- name: "holds"
|
|
x-displayName: Holds
|
|
description: |
|
|
Manage holds
|
|
- name: "illbackends"
|
|
x-displayName: ILL backends
|
|
description: |
|
|
Manage ILL module backends
|
|
- name: "illrequests"
|
|
x-displayName: ILL requests
|
|
description: |
|
|
Manage ILL requests
|
|
- name: "items"
|
|
x-displayName: Items
|
|
description: |
|
|
Manage items
|
|
- name: "library"
|
|
x-displayName: Libraries
|
|
description: |
|
|
Manage libraries
|
|
- name: "orders"
|
|
x-displayName: Orders
|
|
description: |
|
|
Manage acquisition orders
|
|
- name: "oauth"
|
|
x-displayName: "OAuth"
|
|
description: |
|
|
Handle OAuth flows
|
|
- name: "patrons"
|
|
x-displayName: Patrons
|
|
description: |
|
|
Manage patrons
|
|
- name: "quotes"
|
|
x-displayName: Quotes
|
|
description: |
|
|
Manage quotes
|
|
- name: "return_claims"
|
|
x-displayName: Return claims
|
|
description: |
|
|
Manage return claims
|
|
- name: "smtp_servers"
|
|
x-displayName: SMTP servers
|
|
description: |
|
|
Manage SMTP servers configurations
|
|
- name: "transfer"
|
|
x-displayName: Transfer limits
|
|
description: |
|
|
Manage transfer limits
|
|
- name: "vendors"
|
|
x-displayName: "Vendors"
|
|
description: |
|
|
Manage vendors for the acquisitions module
|
|
- name: "batch_import_profiles"
|
|
x-displayName: Batch import profiles
|
|
description: |
|
|
Manage batch import profiles
|