Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
4 changes: 1 addition & 3 deletions draft/openapi/components/parameters/id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ required: true
schema:
$ref: ../schemas/id.yaml
description: |
Public global object identifier.

Identifiers should be UUID v4.
Public global object identifier, see [_id URI representation](#id-uri-representation).

Once object is assigned a global identifier, it should never change.
Internally local identifiers, should be associated with public
Expand Down
9 changes: 7 additions & 2 deletions draft/openapi/components/schemas/id.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
oneOf:
- type: integer
- type: string
pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}|=[^\s]+|[^=\s][^\s]*)$
Comment thread
Gustascct marked this conversation as resolved.
Outdated
examples:
- abdd1245-bbf9-4085-9366-f11c0f737c1d
- =some-string-id
- 42,LT
- 123
37 changes: 33 additions & 4 deletions draft/openapi/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ All API URL's are constructed using one of the following patters:
<span class="green">dataset</span> `/`
<span class="green">model<span>

- Get single object:
- Get single object, see [_id URI representation](#id-uri-representation):

`https://`
<span class="green">domain</span> `/`
Expand Down Expand Up @@ -782,14 +782,39 @@ same building, but the global identifier must be the same for all datasets.
Global identifiers must be assigned to all objects using a reserved property
name `_id`.

For example we can have multiple datasets containing data abould the same
For example we can have multiple datasets containing data about the same
building, since building is the same, single global identifier must be used:

```text
/datasets/gov/rc/ar/uapi/text_with_coordinates/Address/e96cc0cc-08be-460d-a887-98f80612a402
/datasets/gov/rc/ntr/uapi/report/Pastatas/e96cc0cc-08be-460d-a887-98f80612a402
```

<a id="id-uri-representation"></a>

### _id URI representation
Comment thread
Gustascct marked this conversation as resolved.
Outdated

Global identifiers should be defined in the manifest, using `_id` as the property
Comment thread
Gustascct marked this conversation as resolved.
Outdated
name. `_id` can be defined as one of these types:
- String
- Base32
Comment thread
Gustascct marked this conversation as resolved.
Outdated
- UUID
- Integer
Comment thread
Gustascct marked this conversation as resolved.
Outdated


The operations, which use `_id` in their URI, change depending on the field type.
If the `_id` is of type String or Base32, then the `_id` is specified in the URI with an equal sign:

```code
/=id
```

Otherwise, for UUID and Integer types, the `_id` is specified in the URI directly without an equal sign:
``
```code``
/id``
`````
Comment thread
Gustascct marked this conversation as resolved.
Outdated

## Model

Real world entities are identified using global identifiers. Each real world
Expand Down Expand Up @@ -964,8 +989,12 @@ Version number is a singe positive integer number specifying major version of th
All objects must have a revision number provided as reserved `_revision`
property name.

Revision is a string, that identifies object version. This might be a UUID
string.
Revision can be defined in the manifest, using `_revision` as the property
name. `_revision` can be defined as one of these types:
- String
- Base32
- UUID
- Integer

When update action is made on an object, revision number must always be
provided, in order to compare object version received by the Client and object
Expand Down
Loading