Slide 1

Slide 1 text

What the $ref Create composable JSON Schemas Lightning Talk, Niklas

Slide 2

Slide 2 text

JSON Schema https://json-schema.org/ 2

Slide 3

Slide 3 text

JSON Schema Also, refer to my past Lightning Talk about JSON Schema validation: Slides 3

Slide 4

Slide 4 text

JSON Schema 4

Slide 5

Slide 5 text

Element Templates JSON Schema 5

Slide 6

Slide 6 text

Element Templates JSON Schema 6

Slide 7

Slide 7 text

New: C8 Element Templates 7

Slide 8

Slide 8 text

Problem(s) First contribution - hard to comprehend what’s going on Extending is (quite) impossible Don’t repeat yourself 8

Slide 9

Slide 9 text

Problem(s) First contribution - hard to comprehend what’s going on Extending is (quite) impossible Don’t repeat yourself Goal: Make JSON Schema composable 9

Slide 10

Slide 10 text

$ref property https://json-schema.org/un derstanding-json-schema/st ructuring.html 10

Slide 11

Slide 11 text

$ref property 11

Slide 12

Slide 12 text

$ref property What’s the problem here? 12

Slide 13

Slide 13 text

$ref property https://json-schema.org/un derstanding-json-schema/st ructuring.html 13

Slide 14

Slide 14 text

$ref property https://json-schema.org/un derstanding-json-schema/st ructuring.html 14

Slide 15

Slide 15 text

$ref property https://ajv.js.org/guide/combining -schemas.html 15

Slide 16

Slide 16 text

$ref property 16

Slide 17

Slide 17 text

JSON Schema was not built with inheritance in mind (json-schema-org/json-schema-spec#348) $ref property 17

Slide 18

Slide 18 text

Solution: json-schema-ref-parser 18

Slide 19

Slide 19 text

Composable JSON Schema (sketch) 19

Slide 20

Slide 20 text

Composable JSON Schema (sketch) Definitions base-properties cloud-properties platform-properties base groups scopes Product Export 20

Slide 21

Slide 21 text

Composable JSON Schema (sketch) platform.json Definitions base-properties cloud-properties platform-properties base groups scopes Product Export 21

Slide 22

Slide 22 text

Composable JSON Schema (sketch) platform.json Definitions base-properties cloud-properties platform-properties base groups scopes Product Export schema.json 22

Slide 23

Slide 23 text

Composable JSON Schema (sketch) platform.json cloud.json Definitions base-properties cloud-properties platform-properties base groups scopes Product Export schema.json 23

Slide 24

Slide 24 text

Composable JSON Schema (sketch) platform.json cloud.json Definitions base-properties cloud-properties platform-properties base groups scopes Product Export schema.json cloud.json 24

Slide 25

Slide 25 text

Composable JSON Schema (sketch) platform.json cloud.json Definitions base-properties cloud-properties platform-properties base groups scopes Product Export schema.json cloud.json Backwards compatibility 25

Slide 26

Slide 26 text

26

Slide 27

Slide 27 text

Summary ● Check it out: https://github.com/camunda/element-templates-json-schema/pull/41 ● No breaking changes, exported schema kept almost the same ● Platform and Cloud have own schema definitions now ● Base definitions can be handled separately, composed later ● We don’t have to bother with the single, huge schema file ● Tests are green, only schemaPath updates needed 27

Slide 28

Slide 28 text

Thank you! 28