|
Last change
on this file since 511 was 460, checked in by alloc, 2 years ago |
|
More OpenAPI specs added
OpenAPI specs cleanup to have everything validate fine
Added CORS support to API endpoints
|
|
File size:
1.2 KB
|
| Rev | Line | |
|---|
| [460] | 1 | openapi: 3.1.0
|
|---|
| 2 | info:
|
|---|
| 3 | title: Item
|
|---|
| 4 | version: '1'
|
|---|
| 5 |
|
|---|
| 6 | components:
|
|---|
| 7 | schemas:
|
|---|
| 8 | ItemElement:
|
|---|
| 9 | type: object
|
|---|
| 10 | properties:
|
|---|
| 11 | name:
|
|---|
| 12 | type: string
|
|---|
| 13 | examples:
|
|---|
| 14 | - woodShapes:VariantHelper
|
|---|
| 15 | localizedName:
|
|---|
| 16 | type: string
|
|---|
| 17 | examples:
|
|---|
| 18 | - Wood Block
|
|---|
| 19 | isBlock:
|
|---|
| 20 | type: boolean
|
|---|
| 21 | required:
|
|---|
| 22 | - name
|
|---|
| 23 | - localizedName
|
|---|
| 24 | - isBlock
|
|---|
| 25 |
|
|---|
| 26 | ItemList:
|
|---|
| 27 | type: array
|
|---|
| 28 | items:
|
|---|
| 29 | $ref: '#/components/schemas/ItemElement'
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | paths:
|
|---|
| 33 | /api/item:
|
|---|
| 34 | get:
|
|---|
| 35 | tags:
|
|---|
| 36 | - GameData
|
|---|
| 37 | summary: Items list
|
|---|
| 38 | description: Fetch a list of defined items
|
|---|
| 39 | operationId: item.get
|
|---|
| 40 | responses:
|
|---|
| 41 | 200:
|
|---|
| 42 | description: List of items
|
|---|
| 43 | content:
|
|---|
| 44 | application/json:
|
|---|
| 45 | schema:
|
|---|
| 46 | type: object
|
|---|
| 47 | properties:
|
|---|
| 48 | data:
|
|---|
| 49 | $ref: '#/components/schemas/ItemList'
|
|---|
| 50 | meta:
|
|---|
| 51 | $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
|
|---|
| 52 | required:
|
|---|
| 53 | - data
|
|---|
| 54 | - meta
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.