Quick declaration (shortcut)

As a reminder you can use a shortcut to quickly declare parameters or variables directly in the declaration of a url (path and query)

link to the article on url parameters shortcut

example of url parameters (path) below

Akwatype :

Generated OpenAPI

 

 

Going further

To go further in the declaration of parameters it is necessary to use the extended parameter declaration syntax.

In the following examples we will declare the path parameters of the url.
The same syntax can be used for the declaration of query, header, cookie and response headers parameters

 

Declaration of parameters with attributes

Akwatype :

Generated OpenAPI

 

Declaration of parameters with an example value

Akwatype :

Generated OpenAPI

 

Declaration of parameters with multiple example values named

Akwatype :

Generated OpenAPI

 

Full parameter declaration with attributes and multiple named value examples

Nothing new : Simply repeat the elements of the previous examples in a complete example.

Akwatype :

 

 

Generated OpenAPI

 

Using a data model type or facade to define path, query, headers, cookie and response headers 

Akwatype considers path, query, headers, cookie and response headers as objects.

it is therefore possible to use a data model type or facade to define them. This is the reason why we have separated the examples from the attribute declaration part. This way we can use a facade to define the attributes and add the examples

In this example the TestPathParams type is used to define the path object with an example associated to the path

 

Type TestPathParams defined in the data model

 

Route défini dans un service

 

Note: All path parameters must be defined in the used facade and all facade fields must be a path parameter