Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike a /distributions endpoint in spec to reduce /version size #441

Draft
wants to merge 1 commit into
base: v2-spec
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 105 additions & 25 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,33 @@ paths:
description: "No version was found for an edition of a dataset using the id, edition and version provided"
500:
$ref: '#/responses/InternalError'
/datasets/{identifier}/editions/{edition}/versions/{version}/distributions:
get:
tags:
- "Public"
summary: "Get a list of dimensions from a dataset"
description: "Get all dimensions which are used in the dataset"
parameters:
- $ref: '#/parameters/edition'
- $ref: '#/parameters/identifier'
- $ref: '#/parameters/version'
- $ref: '#/parameters/limit'
- $ref: '#/parameters/offset'
responses:
200:
description: "A json list of distributions"
schema:
$ref: '#/definitions/Distributions'
400:
description: |
Invalid request, reasons can be one of the following:
* dataset id was incorrect
* edition was incorrect
* version was incorrect
404:
description: "No distributions found for version of an edition of a dataset using the id, edition and version provided"
500:
$ref: '#/responses/InternalError'
/datasets/{identifier}/editions/{edition}/versions/{version}/dimensions:
get:
tags:
Expand Down Expand Up @@ -992,9 +1019,7 @@ definitions:
type: array
items:
type: string
dcatVersionCore:
description: "core quality, mangement and relationship fields for describing a dcat:dataset version. Used by both list and resource endpoints"
type: object
dcatDistributionCore:
properties:
distributions:
description: "A selection of download objects containing information of downloadable files."
Expand All @@ -1007,6 +1032,21 @@ definitions:
description: "spdx:checksum - some guarantees, hence not etag. Could be a more complex object?"
type: string
- $ref: '#/definitions/DownloadObject'
dcatVersionCore:
description: "core quality, mangement and relationship fields for describing a dcat:dataset version. Used by both list and resource endpoints"
type: object
properties:
# distributions:
# description: "A selection of download objects containing information of downloadable files."
# type: array
# items:
# allOf:
# - type: object
# properties:
# checksum:
# description: "spdx:checksum - some guarantees, hence not etag. Could be a more complex object?"
# type: string
# - $ref: '#/definitions/DownloadObject'
version:
description: "A number identifying the version for an edition from a dataset"
example: 1
Expand All @@ -1029,13 +1069,13 @@ definitions:
previous_version:
type: string
format: uri
distributions:
description: "A selection of download objects containing information of downloadable files."
type: array
items:
allOf:
- $ref: '#/definitions/CSVDownload'
- $ref: '#/definitions/DownloadObject'
# distributions:
# description: "A selection of download objects containing information of downloadable files."
# type: array
# items:
# allOf:
# - $ref: '#/definitions/CSVDownload'
# - $ref: '#/definitions/DownloadObject'
Datasets:
description: "A list of datasets"
type: object
Expand Down Expand Up @@ -1083,7 +1123,9 @@ definitions:
LDType:
description: "The linked data vocabulary term for a dataset"
default: "dcat:dataset"
type: string
type: array
items:
type: string
Dataset:
description: "The dataset"
type: object
Expand Down Expand Up @@ -1332,6 +1374,34 @@ definitions:
value:
description: "A list of dimenions that will be added to the instance."
example: "[{\"dimension\": \"dim1\", \"option\": \"op1\"}, {\"dimension\": \"dim1\", \"option\": \"op2\"}, {\"op\": \"add\", \"path\": \"/dim1/options/op1/order\", \"value\": 3}, {\"op\": \"add\", \"path\": \"/dim1/options/op2/node_id\", \"value\": \"node123\"}]"
Distributions:
type: object
allOf:
- $ref: '#/definitions/ListPagination'
- type: object
properties:
"@context":
$ref: '#/definitions/LDContext'
items:
type: array
items:
allOf:
- $ref: '#/definitions/CSVDownload'
- $ref: '#/definitions/DownloadObject'
- type: object
properties:
etag:
type: string
"@type":
allOf:
- $ref: '#/definitions/LDType'
- default: 'dcat:distribution'
_links:
properties:
self:
$ref: '#/links/Self'
version:
$ref: '#/links/Version'
CSVDownload:
description: "Additional fields available for CSV downloads"
type: object
Expand Down Expand Up @@ -1402,6 +1472,10 @@ definitions:
type: array
items:
type: string
latest_distributions:
type: array
items:
$ref: '#/definitions/dcatDistributionCore'
is_based_on:
$ref: '#/definitions/IsBasedOn'
_links:
Expand Down Expand Up @@ -1606,17 +1680,17 @@ definitions:
# type: string
title:
type: string
property_url:
type: string
format: url
value_url:
type: string
format: url
codelist_url:
type: string
format: url
sub_property_of:
type: string
# property_url:
# type: string
# format: url
# value_url:
# type: string
# format: url
# codelist_url:
# type: string
# format: url
# sub_property_of:
# type: string
UpdateDatasetResponse:
description: "A model for the response body when creating a new dataset"
type: object
Expand Down Expand Up @@ -1684,9 +1758,15 @@ definitions:
is_based_on:
$ref: '#/definitions/IsBasedOn'
_embedded:
type: array
items:
$ref: '#/definitions/DimensionCore'
properties:
dimensions:
type: array
items:
$ref: '#/definitions/DimensionCore'
distributions:
type: array
items:
$ref: '#/definitions/dcatDistributionCore'
_links:
$ref: '#/links/VersionLinks'
type:
Expand Down