Files
Phraseanet/API_documentation/v3/schemas.yaml
jygaulier 82a8998cb0 wip doc
- add facets structure
- fix record/story differences
2020-09-23 20:03:02 +02:00

293 lines
7.8 KiB
YAML

RecordPatch_metadata:
type: object
properties:
field_name:
type: string
meta_struct_id:
$ref: '#/ID'
action:
type: string
enum:
- set
- add
- delete
- replace
value:
# todo : change to string, int, number, array
type: string
RecordPatch_status:
type: object
required:
- bit
- state
properties:
bit:
type: integer
minimum: 4
maximum: 31
state:
type: boolean
RecordPatch:
description: 'Metadata, status, collection, etc to be set for a record'
type: object
properties:
metadatas:
type: array
items:
$ref: '#/RecordPatch_metadata'
status:
type: array
items:
$ref: '#/RecordPatch_status'
ApiResponse_meta:
type: object
properties:
api_version:
type: string
request:
type: string
response_time:
type: string
format: date-time
http_code:
type: integer
format: int32
error_type:
type: string
error_message:
type: string
ApiResponse_record:
type: object
properties:
meta:
$ref: '#/ApiResponse_meta'
response:
$ref: '#/Record'
# -------------------- search ---------------
ApiResponse_search:
type: object
properties:
meta:
$ref: '#/ApiResponse_meta'
response:
$ref: '#/ApiResponse_search_response'
ApiResponse_search_response:
type: object
properties:
offset:
type: integer
description: 'The pagination offset as passed (or computed from "page/per_page") in request'
limit:
type: integer
description: 'The pagination limit as passed in request'
count:
type: integer
description: 'The number of results in this page [0...limit]'
total:
type: integer
description: 'The total number of results'
minimum: 1
results:
type: object
properties:
stories:
type: array
items:
$ref: '#/Story'
records:
type: array
items:
$ref: '#/Record'
facets:
type: array
items:
type: object
properties:
name:
type: string
description: 'The unique internal name (=key) for the facet'
example: '_base'
field:
type: string
description: 'Source field (from db structure). Can be also virtual field like "database" '
example: 'database'
values:
type: array
items:
type: object
properties:
value:
type: string
description: 'Human readable value for the value'
example: 'Demo'
raw_value:
type: string
description: 'Real value, to be used to query'
example: 'db_demo'
count:
type: integer
description: 'Number of items matching this value'
query:
type: string
description: 'Formulated query to search items matching this facet'
example: 'database:db_demo'
ID:
type: integer
Permalink:
type: object
properties:
created_on:
type: string
format: date-time
id:
$ref: '#/ID'
is_activated:
type: boolean
label:
type: string
updated_on:
type: string
format: date-time
page_url:
type: string
download_url:
type: string
url:
type: string
Subdef:
type: object
properties:
name:
type: string
permalink:
$ref: '#/Permalink'
height:
type: integer
width:
type: integer
filesize:
type: integer
devices:
type: array
items:
type: string
enum:
- screen
- printer ?
player_type:
type: string
enum:
- IMAGE
mime_type:
type: string
substituted:
type: boolean
created_on:
type: string
format: date-time
updated_on:
type: string
format: date-time
url:
type: string
url_ttl:
type: integer
TechnicalInformation:
type: object
properties:
name:
type: string
value:
type: string
_Record_:
type: object
properties:
databox_id:
$ref: '#/ID'
record_id:
$ref: '#/ID'
title:
type: string
original_name:
type: string
updated_on:
type: string
format: date-time
created_on:
type: string
format: date-time
collection_id:
$ref: '#/ID'
base_id:
$ref: '#/ID'
thumbnail:
$ref: '#/Subdef'
uuid:
type: string
Record:
allOf: # Combines the basic _Record_ and the records-only properties
- $ref: '#/_Record_'
- type: object
properties:
mime_type:
type: string
technical_informations:
type: array
items:
$ref: '#/TechnicalInformation'
sha256:
type: string
phrasea_type:
type: string
enum:
- image
- video
Story:
allOf: # Combines the basic _Record_ and the stories-only properties
- $ref: '#/_Record_'
- type: object
properties:
children_offset:
type: integer
description: 'The children pagination offset ; Always 0'
children_limit:
type: integer
description: 'The children pagination limit ; Equal to "story_children_limit" passed in request'
children_count:
type: integer
description: 'The number of children in "children" array ; [0...limit]'
children_total:
type: integer
description: 'The total number of -visibles for user- children in this story'
children:
type: array
items:
type: object
items:
$ref: '#/Record'
RecordUri:
type: string
example:
'/api/v3/records/1/48'
RecordsUriArray:
type: array
items:
$ref: '#/RecordUri'
ApiResponse_RecordsUriArray:
type: object
properties:
meta:
$ref: '#/ApiResponse_meta'
response:
$ref: '#/RecordsUriArray'