[NETCONF-1026] OpenAPI: Use examples instead of example Created: 10/May/23  Updated: 23/May/23

Status: Open
Project: netconf
Component/s: restconf-openapi
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Medium
Reporter: Ivan Hrasko Assignee: Ivan Hrasko
Resolution: Unresolved Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by NETCONF-999 OpenAPI: Use "example" instead of "de... Resolved

 Description   

https://swagger.io/specification/ says:

Deprecated: The example property has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.

Thus we need to replace our usage of example keyword to examples keyword. Please note that the main difference is that examples is an array according to https://swagger.io/docs/specification/adding-examples/.



 Comments   
Comment by Ivan Hrasko [ 23/May/23 ]

Note that schemas and properties support single example but not multiple examples as is stated in https://swagger.io/docs/specification/adding-examples/.

In addition, what we originally supposed to do is availbale only since openapi 3.1.0 as seen in https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0.

Thus we will postpone this task to time when mi migrate to openapi 3.1.0.

Comment by Ivan Hrasko [ 23/May/23 ]

No, we cannot update to OpenAPI 3.1 because swagger UI does not support it yet: https://github.com/swagger-api/swagger-ui#compatibility

Generated at Wed Feb 07 20:16:29 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.