-
Notifications
You must be signed in to change notification settings - Fork 165
Doesn't work: JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@hasufell Thanks for reporting this! I think the reason for this rather unhelpful error message is the use of merge keys ( YAML merge keys are not very well specified and not very well supported by Jackson ( Multiple sequential merge keys on the same level are generally a problem for this stack. In fact, YAML 1.2 removes them altogether, so that you ideally shouldn't rely on them. Here's the spec and the diff to your original spec I've been using: You should be able to get a more detailed error description by setting the log level of openapi-diff to INFO or WARN:
FWIW, OpenAPI 3.0.3 recommends using YAML 1.2 (which doesn't support merge keys):
|
I applied the patch and now I get:
Note that I have proof that the schema is entirely correct:
|
We are also experiencing the same error with version 5.1.0
in our yml, we don't have "<<:". https://gist.github.com/Yayan89/099cbf29427f24ffd84484c39710a593 |
@Yayan89 I'm unable to reproduce your issue with OpenAPI-Diff 2.0.0-beta.8 and your OpenAPI specification: --- ourContract.yml 2021-03-30 16:08:12.000000000 +0200
+++ ourContract2.yml 2021-03-30 16:07:00.000000000 +0200
@@ -3,7 +3,7 @@
title: "Partage de documents avec l'externe"
description: |
API pour partager des documents.
- version: "1.0.0"
+ version: "2.0.0"
servers:
- url: /api/document-numerique/gerer-partage/pde/v1
@@ -588,13 +588,6 @@
type: string
description: La date où le fichier sera automatiquement envoyé à la corbeille.
format: date-time
- dateSuppression:
- type: string
- description: La date où le fichier sera automatiquement supprimé du système.
- format: date-time
- taille:
- type: string
- description: Taille en bytes
MiseAJourDossier:
type: object
|
I ran into the same failure. It was caused due to the usage of a potentially unsupported version of openapi. I tried 3.1.0 in https://github.com/bigpanther/trober/runs/2284521332?check_suite_focus=true but it did not work. 3.0.3 works fine. |
I have the same probleme with 3.1.x, but 3.0.x works fine. |
anyone has made this work ? :-| |
anyone has solution for this? |
Any updates about 3.1.x support? |
@petkostas You can track and contribute to the respective issue in the Swagger Parser project which is being used by OpenAPI Diff for parsing OpenAPI specifications: |
parser が 3.1.x に対応してないっぽい OpenAPITools/openapi-diff#200 swagger-api/swagger-parser#1535
The solution is Do not put SPACES in the path to your project and yaml. I hope it can help you. |
@AntonTevs Thank you!! |
Closed, as initial issue is not reproduced on the latest build: 2.1.0-beta.12 |
input files: https://gist.github.com/hasufell/1ae28db2326569d885c1e580515dc2f6
Full error:
The text was updated successfully, but these errors were encountered: