-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
Description
Describe the bug
From OpenAPI 3.1, the example
property is deprecated and examples
is preferred and type
property can be a string, but also an array of strings.
The examples
property and the type
as an array seem not to be supported.
To Reproduce
- Create a YAML file in a project
- Copy the following lines in the file:
openapi: '3.1.0'
info:
version: '0.0.1'
title: 'My API'
paths:
/my/route:
get:
operationId: MyRoute
responses:
200:
description: 'Successful response.'
content:
application/json:
schema:
type: object
properties:
a_property:
type: ['string', 'null']
examples:
- null
- "Hello world!"
- See errors
Expected behavior
I would expect examples
and type
as an array to be allowed in the editor part.
Screenshots
Editor complains about those 2 properties:
On the other hand, the preview seems to "understand" the syntax:
Stack trace
No exception.
Desktop (please complete the following information):
- Zalando OpenAPI Editor version: 1.3.0
- IDEA version: PhpStorm 2024.1.1 (Build #PS-241.15989.102, built on April 23, 2024)
- Java version: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
- Operating System & version: Ubuntu 22.04
Additional context
Swagger editor (https://editor-next.swagger.io) does not complain about this YAML file.
Am I wrong anywhere?
Is the OpenAPI 3.1 not supported? If so, is it expected to be supported?
Thank you! 🙏