Hello,
We are doing network automation work for our clients and the cnMaestro REST API has been a huge help. Recently I dug into the deployment and found that there is an included OpenAPI spec. I tried to use it to generate clients that would ease our job to communicate with cnMaestro but I stumbled upon several errors in the definition. I understand that since it’s not provided in the downloads, it probably isn’t supported but you may want to fix them anyway.
- In OpenAPI v3 there is no ‘null’ type as used in
build/device/configuration/enterprise_wifi/wlan_definitions.yaml
at line 113 and many other places. See here. Instead there is thenullable
field. In this example thetime_range
should be defined as follows:
time_range:
description: 'Time range in the format "HH:MM-HH:MM"'
type: string
pattern: >-
^((?:[01]\d:[0-5][0-9]|2[0-3]:[0-5][0-9])(?:\s?)-(?:\s?)(?:[01]\d:[0-5][0-9]|2[0-3]:[0-5][0-9]))$
nullable: true
- The
schema
object cannot contain an array as inschemas/guest_portal.yaml
at line 66. It should be:
schema:
$ref: '../build/guest_portal.yaml#/Api.V1.PUT.Services.wifi-enterprise.Guest_Access.Portals/body'
- In
schemas/guest_portal.yaml
line 50, the definition of the array is missing. As per theschema
definition, if the type isarray
then anitems
object must be present. For example:
properties:
whitelist:
type: array
items:
type: string
- In the OAuth security scheme definition, the
scopes
field is missing but it is required on the spec. - Typos: the word
description
is mistyped asdescripton
ordesription
ordescriptin
in some files. The worddefault
is mistyped asdefauilt
. - You cannot augment the definition of a referenced object as in
build/device/configuration/enterprise_wifi/ap_group.yaml
line 35. Items ofallOf
must beschema
definition but thisrequired
is not. Similar case inbuild/device/configuration/enterprise_wifi/ap_group_definitions.yaml
line 1727. - The
producers
field defined in several files does not exist in the spec. It probably is a leftover from Swagger v2produces
. - There are no schemas defined for any data returned by cnMaestro. Thus the data returned cannot be parsed by generated clients.
It would be really nice and helpful if you released the OpenAPI spec since you’ve done most of the work to develop it anyway.