Details
-
Bug
-
Status: Resolved
-
Medium
-
Resolution: Done
-
None
Description
In DefinitionNames we are trying to pick a number discriminator when we have the same parameters in path. Unfortunately, this logic produces invalid schemas.
It means that we have pair-key1 in URL but pair-key in parameters. The most probable reason is that logic is not taking into account that it has to be executed for each request separately.
The error:
Semantic error at paths./rests/data/aaa-app-config:shiro-configuration/urls={pair-key1}.patch.parameters.0.name
Path parameter "pair-key" must have the corresponding {pair-key} segment in the "/rests/data/aaa-app-config:shiro-configuration/urls={pair-key1}" path
Jump to line 1589
The corresponding fragment:
/rests/data/aaa-app-config:shiro-configuration/urls={pair-key1}:
patch:
description: The urls section of shiro.ini.
summary: PATCH - aaa-app-config - urls
tags:
- controller aaa-app-config
requestBody:
content:
application/yang-data+json:
schema:
$ref: '#/components/schemas/aaa-app-config_shiro-configuration_config_urls_TOP'
application/yang-data+xml:
schema:
$ref: '#/components/schemas/aaa-app-config_shiro-configuration_config_urls'
description: urls_config
parameters:
- name: pair-key
description: The key.
schema:
type: string
in: path
required: true
- name: pair-key1
description: The key.
schema:
type: string
in: path
required: true
responses:
'200':
description: OK
'204':
description: Updated
If you scroll up in full schema you can see at line 1452:
/rests/data/aaa-app-config:shiro-configuration/main={pair-key}:
The full schema can be seen when you insert content of http://localhost:8181/apidoc/openapi3/apis/single into https://editor.swagger.io/.
Attachments
Issue Links
- is blocked by
-
NETCONF-1022 OpenApi: Missing required parameters in swagger schema
-
- Resolved
-
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 105698,17 | Fix invalid swagger schema | master | netconf | Status: MERGED | +2 | +1 |
| 106245,3 | Fix invalid swagger schema | 5.0.x | netconf | Status: MERGED | +2 | +1 |
| 106254,3 | Fix invalid swagger schema | 4.0.x | netconf | Status: MERGED | +2 | +1 |