Skip to content

Commit

Permalink
Merge pull request #30 from directus/oas-fixed
Browse files Browse the repository at this point in the history
New OpenAPI Spec
  • Loading branch information
phazonoverload authored Dec 16, 2024
2 parents 53b87d3 + 1ed52cb commit 442383f
Show file tree
Hide file tree
Showing 321 changed files with 12,525 additions and 6,574 deletions.
110 changes: 110 additions & 0 deletions api-spec/components/parameters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
Id:
description: Identifier for the object.
name: id
in: path
required: true
schema:
type: integer
UUId:
description: Unique identifier for the object.
name: id
in: path
required: true
schema:
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
type: string
Collection:
description: Collection of which you want to retrieve the items from.
name: collection
in: path
required: true
schema:
type: string
Search:
description: Filter by items that contain the given search query in one of their fields.
in: query
name: search
required: false
schema:
type: string
Page:
description: Cursor for use in pagination. Often used in combination with limit.
in: query
name: page
required: false
schema:
type: integer
Offset:
description: How many items to skip when fetching data.
in: query
name: offset
required: false
schema:
type: integer
Sort:
description: >-
How to sort the returned items. `sort` is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (` - `) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV. You can also use a ` ? ` to sort randomly.
in: query
name: sort
required: false
explode: false
schema:
type: array
items:
type: string
Meta:
description: What metadata to return in the response.
in: query
name: meta
required: false
schema:
type: string
Limit:
description: A limit on the number of objects that are returned.
in: query
name: limit
required: false
schema:
type: integer
Filter:
description: Select items in collection by given conditions.
in: query
name: filter
required: false
content:
application/json:
schema:
type: object
example:
<field>:
<operator>: <value>
Fields:
description: Control what fields are being returned in the object.
in: query
name: fields
required: false
explode: false
schema:
type: array
items:
type: string
Export:
name: export
description: Saves the API response to a file. Accepts one of `csv`, `json`, `xml`, `yaml`.
in: query
required: false
schema:
type: string
enum:
- csv
- json
- xml
- yaml
Version:
name: version
description: >-
Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version.
in: query
required: false
schema:
type: string
30 changes: 30 additions & 0 deletions api-spec/components/responses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
NotFoundError:
description: "Error: Not found."
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: integer
format: int64
message:
type: string
UnauthorizedError:
description: "Error: Unauthorized request"
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
code:
type: integer
format: int64
message:
type: string
56 changes: 56 additions & 0 deletions api-spec/components/schemas/_index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
x-metadata:
$ref: x-metadata.yaml
Activity:
$ref: Activity.yaml
Collections:
$ref: Collections.yaml
Comments:
$ref: Comments.yaml
Dashboards:
$ref: Dashboards.yaml
Diff:
$ref: Diff.yaml
Extensions:
$ref: Extensions.yaml
Fields:
$ref: Fields.yaml
Files:
$ref: Files.yaml
Flows:
$ref: Flows.yaml
Folders:
$ref: Folders.yaml
Items:
$ref: Items.yaml
Notifications:
$ref: Notifications.yaml
Operations:
$ref: Operations.yaml
Panels:
$ref: Panels.yaml
Permissions:
$ref: Permissions.yaml
Policies:
$ref: Policies.yaml
Presets:
$ref: Presets.yaml
Query:
$ref: Query.yaml
Relations:
$ref: Relations.yaml
Revisions:
$ref: Revisions.yaml
Roles:
$ref: Roles.yaml
Schema:
$ref: Schema.yaml
Settings:
$ref: Settings.yaml
Shares:
$ref: Shares.yaml
Translations:
$ref: Translations.yaml
Users:
$ref: Users.yaml
Versions:
$ref: Versions.yaml
62 changes: 62 additions & 0 deletions api-spec/components/schemas/activity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
type: object
properties:
id:
description: Unique identifier for the object.
example: 2
type: integer
action:
description: Action that was performed.
example: update
type: string
enum:
- create
- update
- delete
- login
user:
description: The user who performed this action. Many-to-one to users.
type: string
oneOf:
- $ref: Users.yaml
nullable: true
timestamp:
description: When the action happened.
example: '2019-12-05T22:52:09Z'
type: string
format: date-time
ip:
description: The IP address of the user at the time the action took place.
example: 127.0.0.1
oneOf:
- type: string
- format: ipv4
user_agent:
description: User agent string of the browser the user used when the action took place.
example: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/78.0.3904.108 Safari/537.36
type: string
collection:
description: Collection identifier in which the item resides.
oneOf:
- type: string
- $ref: Collections.yaml
item:
description: Unique identifier for the item the action applied to. This is always a string, even for integer primary keys.
example: '328'
type: string
comment:
description: User comment. This will store the comments that show up in the right sidebar of the item edit page in the admin app.
example: null
type: string
nullable: true
origin:
description: Origin of the request when the action took place.
example: https://directus.io
type: string
revisions:
description: Any changes that were made in this activity. One-to-many to revisions.
nullable: true
type: array
items:
oneOf:
- $ref: Revisions.yaml
x-collection: directus_activity
76 changes: 76 additions & 0 deletions api-spec/components/schemas/collections.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
type: object
properties:
collection:
description: Name of the collection. This matches the table name in the database.
example: customers
type: string
icon:
nullable: true
description: Icon displayed in the Data Studio when working with this collection.
type: string
note:
nullable: true
description: Short description displayed in the Data Studio.
type: string
display_template:
nullable: true
description: How items in this collection should be displayed when viewed relationally in the Data Studio.
type: string
hidden:
nullable: false
description: Whether or not this collection is hidden in the Data Studio.
type: boolean
singleton:
nullable: false
description: Whether or not this collection is treated as a singleton.
type: boolean
translations:
description: How this collection's name is displayed in the different languages in the Data Studio.
type: array
nullable: true
archive_field:
description: What field in the collection holds the archived state.
nullable: true
type: string
archive_app_filter:
nullable: false
type: boolean
archive_value:
nullable: true
description: What value the archive field should be set to when archiving an item.
type: string
unarchive_value:
nullable: true
description: What value the archive field should be set to when unarchiving an item.
type: string
sort_field:
nullable: true
description: What field holds the sort value on the collection. The Data Studio uses this to allow drag-and-drop manual sorting.
type: string
accountability:
nullable: true
description: What data is tracked. One of `all`, `activity`.
type: string
item_duplication_fields:
nullable: true
description: What fields are duplicated during "Save as copy" action of an item in this collection.
type: array
sort:
nullable: true
description: What sort order of the collection relative to other collections of the same level.
type: integer
group:
nullable: true
description: The name of the parent collection.
type: string
oneOf:
- $ref: Collections.yaml
collapse:
nullable: false
description: What is the default behavior of this collection or "folder" collection when it has nested collections. One of `open`, `closed`, `locked`.
type: string
versioning:
nullable: false
description: Whether or not Content Versioning is enabled for this collection.
type: boolean
x-collection: directus_collections
42 changes: 42 additions & 0 deletions api-spec/components/schemas/comments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
type: object
properties:
collection:
description: Collection identifier in which the item resides.
example: articles
type: string
id:
description: Unique identifier for the object.
example: 2fab3b9d-0543-4b87-8a30-3c5ee66fedf1
type: string
format: uuid
item:
description: The item the comment is created for.
example: 15
type: string
comment:
description: User comment. This will store the comments that show up in the right sidebar of the item edit page in the Data Studio.
example: This is a comment on an article
type: string
date_created:
description: Timestamp in ISO8601 when the comment was created.
example: 2023-01-15T09:14:52Z
type: string
format: date-time
date_updated:
description: Timestamp in ISO8601 when the comment was last updated.
example: 2023-01-15T09:00:00Z
type: string
format: date-time
user_created:
description: The user who created the comment. Many-to-one to users.
example: 12e62fd0-29c7-4fd3-b3d3-c7a39933e8af
type: string
oneOf:
- $ref: Users.yaml
user_updated:
description: The user who last updated the comment. Many-to-one to users.
example: 12e62fd0-29c7-4fd3-b3d3-c7a39933e8af
type: string
oneOf:
- $ref: Users.yaml
x-collection: directus_comments
Loading

0 comments on commit 442383f

Please sign in to comment.