From 9922cd4c7e1f9ea5a67409f19cb6485f8761ef8d Mon Sep 17 00:00:00 2001 From: Julian Ladisch Date: Sat, 9 Jun 2018 23:37:02 +0200 Subject: [PATCH] Add guides/uuids.md --- guides/index.md | 1 + guides/uuids.md | 18 ++++++++++++++++++ reference/glossary.md | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 guides/uuids.md diff --git a/guides/index.md b/guides/index.md index 2de5f693..526b59dc 100644 --- a/guides/index.md +++ b/guides/index.md @@ -133,6 +133,7 @@ These are listed in the [Start](/start/) section. - For Contextual Query Language (CQL) examples, see the [Glossary](/reference/glossary/#cql), the FOLIO [CQL to PostgreSQL JSON converter](https://github.com/folio-org/cql2pgjson-java), the [API docs](/reference/api/), and the debug output for tests in each backend module. - Use [raml-cop](/guides/raml-cop/) to assess RAMLs, schema, and examples. A guide to its use with some explanations of its messages. - [Conduct cross-module joins via their APIs](cross-module-joins). +- [How to check for a valid UUID](uuids). ### Tutorials diff --git a/guides/uuids.md b/guides/uuids.md new file mode 100644 index 00000000..e3b8f237 --- /dev/null +++ b/guides/uuids.md @@ -0,0 +1,18 @@ +--- +layout: page +title: How to check for a valid UUID +permalink: /guides/uuids/ +menuInclude: no +menuTopTitle: Guides +--- + +The regexp +`^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$` +matches any valid UUID. This accepts v1, v2, v3, v4 and v5 UUIDs as FOLIO allows all of them, +but it excludes the Nil UUID `00000000-0000-0000-0000-000000000000` that usually serves as a +NullObject to be used for the Null Object Pattern. + +A UUID has the form xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx where the version M must be [1-5] +and the variant N must be [89abAB]; see +[UUID at Wikipedia](https://en.wikipedia.org/wiki/Universally_unique_identifier). + diff --git a/reference/glossary.md b/reference/glossary.md index 62eca3c1..5bfeca4b 100644 --- a/reference/glossary.md +++ b/reference/glossary.md @@ -259,6 +259,12 @@ is "searchRetrieve Version 1.0, OASIS Standard". See [Stripes](#stripes) and the various [Stripes entities](#stripes-entities) explained above. +#### UUID + +Universally unique identifier, a 128-bit number, see +[UUID at Wikipedia](https://en.wikipedia.org/wiki/Universally_unique_identifier) +and [How to check for a valid UUID](/guides/uuids/). + #### Vert.x [Vert.x](http://vertx.io) is a toolkit for building scalable, reactive