stephaneey / azure-apim-extension

Full Azure API Management suite and more VSTS extension
MIT License
66 stars 48 forks source link

Swagger validation which was working fine on 12th Feb is now failing validation for type: string, when it contains an example date as value #74

Closed nachiketrss closed 4 years ago

nachiketrss commented 4 years ago

Example Swagger/OpenAPI definition:


                    "DateOfDelivery": {
                      "example": "2019-09-26",
                      "type": "string"
                    },

Describe the bug you're encountering

The above is part of my swagger spec, and is getting validated ok in editor.swagger.io

We have release pipelines configured. The task 'API Management - Create or Update API' is used in the azure devops release pipeline to configure the api. The task's field 'Definition Artifact' is given the path of the swagger spec file.

The pipeline was running OK on around 12th Feb. Since around 13th Feb we started to get validation errors when the pipeline runs.

Error:

2020-02-14T12:21:06.8150207Z Data and type mismatch found. [#/paths/~1order-product/post/responses/200/content/application~1json/schema/properties/DateOfDelivery/example]
@{code=ValidationError; target=representation; message=Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specification https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md (schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v3.0/schema.yaml).}

Has anything changed around these dates to cause such an issue?

Expected behavior

No errors

stephaneey commented 4 years ago

Hello,

It sounds like this is at APIM level that you are encountering a problem. Can you try directly from within the portal to see if your Swagger gets validated correctly. I'm not validating anything. I'm just transferring the "as is" Swagger to the API.

Best Regards

nachiketrss commented 4 years ago

Where in the portal can I try this please?

From: Stephane Eyskens notifications@github.com Sent: 17 February 2020 14:51 To: stephaneey/azure-apim-extension azure-apim-extension@noreply.github.com Cc: Nachiket Kamat nachiket@remotesoftwaresolutions.com; Author author@noreply.github.com Subject: Re: [stephaneey/azure-apim-extension] Swagger validation which was working fine on 12th Feb is now failing validation for type: string, when it contains an example date as value (#74)

Hello,

It sounds like this is at APIM level that you are encountering a problem. Can you try directly from within the portal to see if your Swagger gets validated correctly. I'm not validating anything. I'm just transferring the "as is" Swagger to the API.

Best Regards

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/stephaneey/azure-apim-extension/issues/74?email_source=notifications&email_token=AM2IXOZSG6NM7WGVTGLGGA3RDJJGXA5CNFSM4KWM7RWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL5U2MY#issuecomment-586894643, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM2IXO7MIWLSWC6GQ3QL4MTRDJJGXANCNFSM4KWM7RWA.


Disclaimer: This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to who it is addressed. If you have received this e-mail in error, please delete it immediately and notify the sender. Any views and/or opinions presented are those of its author and do not necessarily represent those of Remote Software Solutions Pvt. Ltd. or any of its subsidiary companies. Unauthorized publication, Use, Dissemination, Forwarding, Printing or Copying of this e-mail and its associated attachments is strictly prohibited. The company is neither liable for proper, complete transmission of information contained in this communication, nor any delay in its receipt, or that the e-mail is virus free.

stephaneey commented 4 years ago

Well, you click on your APIM instance the new API, import swagger and see what it spits out!