Issue A: Currently, ODL OpenApi generates examples for POST requests which contain all configuration children in payload.
This is not correct for both XML and JSON because we cannot create multiple resources with POST request.
Issue B: We can try to remove all data but the key from payload and we get working example for JSON:
POST /rests/data/network-topology:network-topology/topology=topology-id
{ "topology-id": "topology-id" }
But even this approach does not work for XML, for example:
POST /rests/data/network-topology:network-topology/topology=topology-id
<?xml version="1.0" encoding="UTF-8"?> <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology"> <topology-id xmlns="urn:TBD:params:xml:ns:yang:network-topology">topology-id</topology-id> </topology>
Because Swagger UI automatically encloses child into topology element (what's correct behavior for XML payloads).
Instead we should just POST one child as follows:
<?xml version="1.0" encoding="UTF-8"?> <topology-id xmlns="urn:TBD:params:xml:ns:yang:network-topology">Some topology-id</topology-id>
Solution: POST payloads should contains only the key (lists with key) or empty body (lists without key or containers). Issue B will be addressed separately.
- blocks
-
NETCONF-1077 OpenApi: Missing "data" path for POST requests
- Open
-
NETCONF-1057 OpenApi: Eliminate TOP schemas
- Resolved
- is blocked by
-
NETCONF-1101 OpenApi: Remove incorrect list POST requests
- Resolved
-
NETCONF-1071 OpenApi: Create POST request only for module's top elements
- Confirmed
- relates to
-
NETCONF-938 Cannot generate API docs for Junos device
- Resolved
-
NETCONF-1137 OpenApi: Add description to POST requests
- Resolved