You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use NSwag together with the Swagger API definition provided by Harbor.
The client can be generated just find, however, when I make a call to the Swagger API to this operation:
It will cause a deserialization exception in the Newtonsoft JSON library behind the generated client. I think it has something to do with the fact that the schema of the response body is defined like this:
...
responses:
'200':
description: Success
headers:
Content-Type:
description: The content type of the vulnerabilities addition
type: string
schema:
type: string
However, the actual response will never be a JSON string literal, but rather an arbitrary JSON object. I guess this confuses the Newtonsoft parser (and most likely any other parser that would expect a regular string instead.
I suggest to just introduce an any-type there instead:
...
responses:
'200':
description: Success
headers:
Content-Type:
description: The content type of the vulnerabilities addition
type: string
schema: {}
The text was updated successfully, but these errors were encountered:
I use NSwag together with the Swagger API definition provided by Harbor.
The client can be generated just find, however, when I make a call to the Swagger API to this operation:
It will cause a deserialization exception in the Newtonsoft JSON library behind the generated client. I think it has something to do with the fact that the schema of the response body is defined like this:
However, the actual response will never be a JSON string literal, but rather an arbitrary JSON object. I guess this confuses the Newtonsoft parser (and most likely any other parser that would expect a regular string instead.
I suggest to just introduce an any-type there instead:
The text was updated successfully, but these errors were encountered: