[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: |
|
||||||||
| 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 |