You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/developer-guide/modules/tooling-guide/pages/bamm-cli.adoc
+22-25Lines changed: 22 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
[[bamm-cli]]
4
4
= BAMM CLI
5
5
6
-
The BAMM CLI is a command line tool for the validation of Aspect models and the generation of artifacts, such as documentation or code, from Aspect models.
6
+
The BAMM CLI is a command line tool for the validation of Aspect Models and the generation of artifacts, such as documentation or code, from Aspect Models.
=== Mapping between the Aspect models and the OpenAPI Specification
143
+
=== Mapping between the Aspect Models and the OpenAPI Specification
144
144
145
145
In this section, a detailed description of the mapping between individual Aspect elements and the OpenAPI specification is given.
146
-
To make it easier to follow, the mapping is explained based on a concrete example, divided into logically coherent blocks. Please bear in mind
147
-
that these blocks are snippets or fragments of a larger whole; viewed in isolation they do not necessarily form a valid or meaningful aspect model or OpenAPI specification.
146
+
To make it easier to follow, the mapping is explained based on a concrete example, divided into logically coherent blocks.
147
+
Please bear in mind that these blocks are snippets or fragments of a larger whole; viewed in isolation they do not necessarily form a valid or meaningful Aspect Model or OpenAPI specification.
148
148
149
149
==== Naming and versioning
150
150
@@ -154,12 +154,12 @@ Please consider the following model fragment, with the attention focused on the
<1> prefix used to build the full URN of :Test Aspect
163
163
<2> the preferred name of the Aspect in language of user's choice
164
164
<3> the name of the Aspect
165
165
@@ -175,12 +175,12 @@ For the generated OpenAPI Specification, the following mapping would apply:
175
175
}
176
176
}
177
177
----
178
-
<1> depending on parameters used when generating the specification, this is either the major version of the full Aspect URN (*2*.0.0),
179
-
or it can be the full version (`v2.0.0`), if using `-sv` (semantic version) command line switch
178
+
179
+
<1> depending on parameters used when generating the specification, this is either the major version of the full Aspect URN (*2*.0.0), or it can be the full version (`v2.0.0`), if using `-sv` (semantic version) command line switch
180
180
<2> if present, `bamm:preferredName` is used as the value for the `title` element of the specification
181
-
<3> as `bamm:preferredName` is an optional element, in cases when it is missing the value of `bamm:name` is used instead
181
+
<3> as `bamm:preferredName` is an optional element, in cases when it is missing the name of the Aspect is used instead
182
182
183
-
The version information as described above is also used in the url definitions of the `servers` block of the specification:
183
+
The version information as described above is also used in the URL definitions of the `servers` block of the specification:
184
184
185
185
[source,JSON]
186
186
----
@@ -222,12 +222,11 @@ For an example Aspect from the following fragment:
bamm:description "Description of Property1"@en; <5>
232
231
bamm:characteristic :Enum. <6>
233
232
----
@@ -237,7 +236,7 @@ an entry like the one given in the following JSON will be generated:
237
236
[source,JSON]
238
237
----
239
238
"Test" : { // <1>
240
-
"type" : "object",
239
+
"type" : "object",
241
240
"properties" : {
242
241
"prop1" : { // <2>
243
242
"description" : "Description of Property1", // <5>
@@ -251,16 +250,15 @@ an entry like the one given in the following JSON will be generated:
251
250
}
252
251
},
253
252
"required" : [ "prop1", "givenName" ] // <2> <3>
254
-
}
253
+
}
255
254
----
255
+
256
256
<1> the name of the Aspect is used to name the schema object for the aspect
257
257
<2> with plain property references, the name of the property is used to name the property definition
258
258
<3> in cases where a payload name is defined on a specific property, it is used in preference to the plain property name
259
259
<4> if the property use is also defined as optional, the property will not be included in the list of the required properties
260
260
<5> the values of `bamm:description` elements in property definitions are included in the generated JSON
261
-
<6> for each of the properties characteristics an entry in `components/schemas` is generated and referenced here; if the characteristic is of complex type,
262
-
the whole procedure is applied recursively to the complex type's properties
263
-
261
+
<6> for each of the properties characteristics an entry in `components/schemas` is generated and referenced here; if the characteristic is of complex type, the whole procedure is applied recursively to the complex type's properties
264
262
265
263
==== Mapping of Aspect's operations
266
264
@@ -330,6 +328,7 @@ The available operations are then added to the `components/schemas` part:
330
328
}
331
329
}
332
330
----
331
+
333
332
<1> the names of the input
334
333
<2> and output parameters are reflected in the properties generated for the request/response objects
335
334
<3> the characteristics are generated
@@ -340,18 +339,16 @@ For technical reasons, there may be a slight variation in the generated JSON dep
340
339
341
340
==== Mapping of Collections
342
341
343
-
There are some additional JSON entries generated for complex types related to various types of collections to facilitate
344
-
access to the individual elements of these collections via paging. As these entries are rather of static character
345
-
without direct references to any aspect elements, it suffices here to give a short overview about which kind of paging
346
-
is available for which type of collection:
342
+
There are some additional JSON entries generated for complex types related to various types of collections to facilitate access to the individual elements of these collections via paging.
343
+
As these entries are rather of static character without direct references to any aspect elements, it suffices here to give a short overview about which kind of paging is available for which type of collection:
347
344
348
345
* a general Collection - cursor and/or offset based paging
349
346
* TimeSeries - cursor, offset and/or time based paging
350
347
351
348
[[models-directory-structure]]
352
349
== Understanding the models directory structure
353
350
354
-
An Aspect model file can contain an Aspect definition as well as other model elements that are defined in the same versioned namespace, as described in the xref:bamm-specification:ROOT:namespaces.adoc[Namespaces section of the
351
+
An Aspect Model file can contain an Aspect definition as well as other model elements that are defined in the same versioned namespace, as described in the xref:bamm-specification:ROOT:namespaces.adoc[Namespaces section of the
355
352
specification].
356
353
Additionally, it is possible to split one versioned namespace across multiple files, for example to define a Characteristic that is usable in multiple Aspects into its own file.
357
354
In order for BAMM CLI to be able to resolve references to such externally defined model elements, the model files must be organized in a directory structure as follows:
0 commit comments