Skip to content

Commit f6a887b

Browse files
authored
Merge pull request #13 from felleslosninger/gne-slugs
Slugs
2 parents 39d5d7f + 32e0117 commit f6a887b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

typespec/einnsyn.arkiv.models.tsp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ namespace Enhet {
157157
@extension("x-idPrefix", "enh")
158158
model Enhet extends Base.Base {
159159
@visibility(Lifecycle.Read) entity: "Enhet";
160+
161+
/**
162+
* A URL-friendly unique slug for the resource.
163+
*/
164+
@pattern("^[a-z0-9\\-]+$") slug?: string;
165+
160166
navn: string;
161167
navnNynorsk?: string;
162168
navnEngelsk?: string;
@@ -233,7 +239,9 @@ namespace Journalpost {
233239
legacyFoelgsakenReferanse?: string[];
234240
administrativEnhet?: string;
235241
administrativEnhetObjekt?: ExpandableField<Enhet.Enhet>;
236-
@visibility(Lifecycle.Read, Lifecycle.Update) saksmappe?: ExpandableField<Saksmappe.Saksmappe>;
242+
243+
@visibility(Lifecycle.Read, Lifecycle.Update)
244+
saksmappe?: ExpandableField<Saksmappe.Saksmappe>;
237245
}
238246
}
239247

@@ -336,6 +344,11 @@ namespace Mappe {
336344
* Mappe
337345
*/
338346
model Mappe extends ArkivBase.ArkivBase {
347+
/**
348+
* A URL-friendly unique slug for the resource.
349+
*/
350+
@pattern("^[a-z0-9\\-]+$") slug?: string;
351+
339352
/**
340353
* The title of the Mappe, with sensitive information redacted.
341354
*/
@@ -347,7 +360,6 @@ namespace Mappe {
347360
offentligTittelSensitiv: string;
348361

349362
@maxLength(1000) beskrivelse?: string;
350-
351363
noekkelord?: string;
352364

353365
/**
@@ -477,6 +489,11 @@ namespace Registrering {
477489
* Registrering
478490
*/
479491
model Registrering extends ArkivBase.ArkivBase {
492+
/**
493+
* A URL-friendly unique slug for the resource.
494+
*/
495+
@pattern("^[a-z0-9\\-]+$") slug?: string;
496+
480497
/**
481498
* The title of the resource, with sensitive information redacted.
482499
*/

0 commit comments

Comments
 (0)