Skip to content

Commit

Permalink
Batching module basis
Browse files Browse the repository at this point in the history
  • Loading branch information
joostfarla committed Nov 29, 2024
1 parent 9240cd9 commit aace2ee
Show file tree
Hide file tree
Showing 13 changed files with 330 additions and 39 deletions.
1 change: 1 addition & 0 deletions API-strategie-modules/batching/abstract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module outlines a structured approach for performing batch operations on APIs. The primary goal of batching is to enhance efficiency and scalability, particularly in scenarios where a client application needs to access multiple resources simultaneously. The module provides guidelines for request formatting, response handling, and error management. By adhering to these guidelines, developers can ensure seamless interoperability while improving system performance and reliability.
39 changes: 39 additions & 0 deletions API-strategie-modules/batching/collection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Collection resources

TODO

## Collection request

<div class="rule" id="/batching/req-collection" data-type="technical">
<p class="rulelab">Specify a list of collection requests when batching collection resources</p>
<dl>
<dt>Statement</dt>
<dd>
<p>When requesting a batch of collection resources, a list of collection requests must be specified.</p>
<div class="example">
<p>Example request when requesting two address collection resources in a single batch operation:</p>
<pre>
// POST https://api.example.org/v1/adressen/_batch
{
"requests": [
{ "filter": { "postcode": "1234AB", "huisnummer": 1 }},
{ "filter": { "postcode": "3456XY", "huisnummer": 32 }}
]
}
</pre>
</div>
</dd>
<dt>Rationale</dt>
<dd>
TODO
</dd>
<dt>Implications</dt>
<dd>
TODO
</dd>
</dl>
</div>

## Collection response

TODO
11 changes: 11 additions & 0 deletions API-strategie-modules/batching/endpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Batch endpoints

As described in the [[ADR]], there is a distinction between singular and collection resources. When applying batch operations, the request and response characteristics are different.

## Request format

TODO

## Response format

TODO
3 changes: 3 additions & 0 deletions API-strategie-modules/batching/existing-standards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Existing standards

TODO
89 changes: 89 additions & 0 deletions API-strategie-modules/batching/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<script
src="../../media/respec/organisation-config.js"
class="remove"
></script>
<script src="js/config.js" class="remove"></script>
<script class="remove">
const respecConfig = { ...organisationConfig, ...documentConfig };
document.title = respecConfig.title;
</script>
<script
src="https://gitdocumentatie.logius.nl/publicatie/respec/builds/respec-nlgov.js"
class="remove"
async
></script>
<script
class="remove"
src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"
></script>
<script src="../../media/respec/rules.js" class="remove"></script>
<link
rel="stylesheet"
type="text/css"
href="../../media/respec/style.css"
/>
<link
rel="shortcut icon"
type="image/x-icon"
href="https://tools.geostandaarden.nl/respec/style/logos/Geonovum.ico"
/>
</head>

<body>
<section
id="abstract"
data-include-format="markdown"
data-include="abstract.md"
></section>
<section id="sotd"></section>
<section
id="introduction"
class="informative"
data-include-format="markdown"
data-include="introduction.md"
></section>
<section
id="summary"
data-include-format="markdown"
data-include="summary.md"
></section>
<section
id="endpoints"
class="informative"
data-include-format="markdown"
data-include="endpoints.md"
></section>
<section
id="singular"
class="informative"
data-include-format="markdown"
data-include="singular.md"
></section>
<section
id="collection"
class="informative"
data-include-format="markdown"
data-include="collection.md"
></section>
<section
id="openapi-components"
class="informative"
data-include-format="markdown"
data-include="openapi-components.md"
></section>
<section
id="existing-standards"
class="informative"
data-include-format="markdown"
data-include="existing-standards.md"
></section>
</body>
</html>
3 changes: 3 additions & 0 deletions API-strategie-modules/batching/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Introduction

TODO
45 changes: 45 additions & 0 deletions API-strategie-modules/batching/js/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var documentConfig = {
title: "Batching",
specStatus: "wv",
specType: "st",
pubDomain: "api",
license: "cc-by",
shortName: "API-Strategie-mod-batching",
edDraftURI:
"https://github.com/Geonovum/KP-APIs/tree/master/API-strategie-modules/batching",
editors: [
{
name: "Joost Farla",
company: "Geonovum",
companyURL: "https://www.geonovum.nl",
},
],
authors: [
{
name: "Joost Farla",
company: "Geonovum",
companyURL: "https://www.geonovum.nl",
},
{
name: "Frank Terpstra",
company: "Geonovum",
companyURL: "https://www.geonovum.nl",
},
{
name: "Martin van der Plas",
company: "Logius",
companyURL: "https://www.logius.nl",
},
{
name: "Peter Haasnoot",
company: "Logius",
companyURL: "https://www.logius.nl",
},
{
name: "Pano Maria",
company: "Skemu",
companyURL: "https://skemu.com",
},
],
github: "https://github.com/Geonovum/KP-APIs",
};
3 changes: 3 additions & 0 deletions API-strategie-modules/batching/openapi-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# OpenAPI components

TODO
53 changes: 53 additions & 0 deletions API-strategie-modules/batching/singular.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Singular resources

TODO

## Singular request

<div class="rule" id="/batching/req-singular" data-type="technical">
<p class="rulelab">Specify a list of singular requests when batching singular resources</p>
<dl>
<dt>Statement</dt>
<dd>
<p>When requesting a batch of singular resources, a list of singular requests must be specified.</p>
<p>Each singular request must contain at least the unique identifier of the thing that the singular resource represents, using the <code>key</code> property. In most cases, things are identified by a single scalar value (string or number). However, they could also be identified by a compound value, consisting of multiple scalar values (in the resource URI, they would typically be represented by multiple path segments).</p>
<div class="example">
<p>An example request for requesting two building resources in a single batch operation:</p>
<pre>
// POST https://api.example.org/v1/gebouwen/_batch
{
"requests": [
{ "key": "3b9710c4-6614-467a-ab82-36822cf48db1" },
{ "key": "609b0651-acad-4091-9144-432621df8bf8" }
]
}
</pre>
</div>
<p>In case of a compound identifier, the value of the <code>key</code> property must be an array, in the exact same order as the path segments of the corresponding resource URI. The value type of the <code>key</code> property must be identical to the original value of the identifier. In case of a compound identifier, this could differ per part.</p>
<div class="example">
<p>When a singular resource has a compound identifier, an array value must be provided. In this example, the first identifier part is a string, and the second part is numeric.</p>
<pre>
// POST https://api.example.org/v1/gebouwen/_batch
{
"requests": [
{ "key": ["key-1-part-1", 123] },
{ "key": ["key-2-part-1", 456] }
]
}
</pre>
</div>
</dd>
<dt>Rationale</dt>
<dd>
TODO
</dd>
<dt>Implications</dt>
<dd>
TODO
</dd>
</dl>
</div>

## Singular response

TODO
5 changes: 5 additions & 0 deletions API-strategie-modules/batching/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Summary

## List of technical rules

<ul id="technicalList"></ul>
39 changes: 20 additions & 19 deletions inleiding-eng.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This chapter gives an introduction on the 'Nederlandse API strategie'. The stategy is build up of multiple documents, standards and modules. The NL API Strategy is being further developed and managed by [the Knowledge Platform API's](https://www.geonovum.nl/themas/kennisplatform-apis).

## Status
## Status

[GitHub](https://github.com/geonovum/KP-APIs/issues) can be used to review the current developments concerning the Dutch / NL API Strategy by the Knowledge platform APIs.

## Auteurs
## Authors

Only a limited number of authors are mentioned, but this strategy is being worked on by many more people.
The well-known authors are the leaders of the Knowledge platform working groups such as API Strategy, Architecture, Security, Design Rules, Authentication and Authorization, Strategy and Policy, and User Wishes.
Expand All @@ -22,20 +22,21 @@ The API strategy consists of an introductory document, various normative documen

The various components of the NL API Strategy contain the following documents:

| element | documentname & </br> Reference to the published version | Status | Version |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ----------------------- |
| General | [Inleiding NL API Strategie](https://geonovum.github.io/KP-APIs/API-strategie-algemeen/Inleiding/) | Established </br> (by Knowledge platform APIs) | 09-03-2022 |
| General | [Architectuur NL API Strategie](https://geonovum.github.io/KP-APIs/API-strategie-algemeen/Architectuur/) | Established </br> (by Knowledge platform APIs) | 09-03-2022 |
| General | [Gebruikerswensen NL API Strategie](https://geonovum.github.io/KP-APIs/API-strategie-algemeen/Gebruikerswensen/) | Established </br> (by Knowledge platform APIs) | 09-03-2022 |
| Normative standard | [API Design Rules (ADR)](https://gitdocumentatie.logius.nl/publicatie/api/adr/) | Mandatory </br> (pas toe leg uit) | 09-07-2020 </br> v1.0.0 |
| Mandatory standard | [Open API Specification (OAS)](https://forumstandaardisatie.nl/open-standaarden/openapi-specification) | Mandatory </br> (pas toe leg uit) | 25-05-2018 </br> v3.0.0 |
| Normative standard | [NL GOV OAuth profiel](https://gitdocumentatie.logius.nl/publicatie/api/oauth/) | Mandatory </br> (pas toe leg uit) | 09-07-2020 </br> v1.0.0 |
| Proposed standard | [NL GOV OpenID Connect profile](https://logius.gitlab.io/oidc/) | Almost Mandatory* </br> (pas toe leg uit) | 18-02-2021 </br> v1.0.0 |
| Mandatory standard | [Digikoppeling REST API koppelvlak specificatie](https://gitdocumentatie.logius.nl/publicatie/dk/restapi/) | Mandatory </br> (pas toe leg uit) | 14-11-2022 </br> v1.1.1 |
| Additional module | [API Geospatial Design Rules module](https://docs.geostandaarden.nl/api/API-Strategie-mod-geo/) | Established </br> (by Knowledge platform APIs) | 23-05-2023 |
| Additional module | [API Transport Security module](https://geonovum.github.io/KP-APIs/API-strategie-modules/transport-security/) | Stable </br> (working group Knowledge platform APIs) | 11-07-2023 |
| Additional module | [API Access control module](https://geonovum.github.io/KP-APIs/API-strategie-modules/access-control/) | Stable </br> (working group Knowledge platform APIs) | 11-07-2023 |
| Additional module | [API Naming conventions module](https://geonovum.github.io/KP-APIs/API-strategie-modules/naming-conventions/) | Stable </br> (working group Knowledge platform APIs) | 12-07-2023 |
| Additional module | [API Hypermedia module](https://geonovum.github.io/KP-APIs/API-strategie-modules/hypermedia/) | Stable </br> (working group Knowledge platform APIs) | 12-07-2023 |

* On 21 September 2023, the OBDO will decide whether to include the OIDC profile in the list of mandatory standards of the 'Forum Standaardisatie'.
| element | documentname & </br> Reference to the published version | Status | Version |
| ------------------ | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ----------------------- |
| General | [Inleiding NL API Strategie](https://geonovum.github.io/KP-APIs/API-strategie-algemeen/Inleiding/) | Established </br> (by Knowledge platform APIs) | 09-03-2022 |
| General | [Architectuur NL API Strategie](https://geonovum.github.io/KP-APIs/API-strategie-algemeen/Architectuur/) | Established </br> (by Knowledge platform APIs) | 09-03-2022 |
| General | [Gebruikerswensen NL API Strategie](https://geonovum.github.io/KP-APIs/API-strategie-algemeen/Gebruikerswensen/) | Established </br> (by Knowledge platform APIs) | 09-03-2022 |
| Normative standard | [API Design Rules (ADR)](https://gitdocumentatie.logius.nl/publicatie/api/adr/) | Mandatory </br> (pas toe leg uit) | 09-07-2020 </br> v1.0.0 |
| Mandatory standard | [Open API Specification (OAS)](https://forumstandaardisatie.nl/open-standaarden/openapi-specification) | Mandatory </br> (pas toe leg uit) | 25-05-2018 </br> v3.0.0 |
| Normative standard | [NL GOV OAuth profiel](https://gitdocumentatie.logius.nl/publicatie/api/oauth/) | Mandatory </br> (pas toe leg uit) | 09-07-2020 </br> v1.0.0 |
| Proposed standard | [NL GOV OpenID Connect profile](https://logius.gitlab.io/oidc/) | Almost Mandatory\* </br> (pas toe leg uit) | 18-02-2021 </br> v1.0.0 |
| Mandatory standard | [Digikoppeling REST API koppelvlak specificatie](https://gitdocumentatie.logius.nl/publicatie/dk/restapi/) | Mandatory </br> (pas toe leg uit) | 14-11-2022 </br> v1.1.1 |
| Additional module | [API Geospatial module](https://docs.geostandaarden.nl/api/API-Strategie-mod-geo/) | Established </br> (by Knowledge platform APIs) | 23-05-2023 |
| Additional module | [API Transport Security module](https://geonovum.github.io/KP-APIs/API-strategie-modules/transport-security/) | Stable </br> (working group Knowledge platform APIs) | 11-07-2023 |
| Additional module | [API Access control module](https://geonovum.github.io/KP-APIs/API-strategie-modules/access-control/) | Stable </br> (working group Knowledge platform APIs) | 11-07-2023 |
| Additional module | [API Naming conventions module](https://geonovum.github.io/KP-APIs/API-strategie-modules/naming-conventions/) | Stable </br> (working group Knowledge platform APIs) | 12-07-2023 |
| Additional module | [API Hypermedia module](https://geonovum.github.io/KP-APIs/API-strategie-modules/hypermedia/) | Stable </br> (working group Knowledge platform APIs) | 12-07-2023 |
| Additional module | [API Batching module](https://geonovum.github.io/KP-APIs/API-strategie-modules/batching/) | Draft </br> (working group Knowledge platform APIs) | |

- On 21 September 2023, the OBDO will decide whether to include the OIDC profile in the list of mandatory standards of the 'Forum Standaardisatie'.
Loading

0 comments on commit aace2ee

Please sign in to comment.