Hi,
I tried pointing the provider at an OpenApi schema on a new project at work, and got a NullReferenceException from it, causing the build to fail.
Trying to minimise the issue, it looks like if I have something like
{
"openapi": "3.1.1",
"info": {
"title": "Testing | v1",
"version": "0.2.0.0"
},
"paths": {
"/api/v1/catalogues/scan": {
"post": {
"tags": [
"Catalogue"
],
"summary": "Testing",
"description": "Testing",
"operationId": "Scan",
"parameters": [
{
"name": "properties",
"in": "header",
"description": "header description",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"stage-location": {
"type": "string",
"description": "location"
},
"file-size": {
"minimum": 0,
"type": "integer",
"format": "int64"
}
}
}
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
}
}
}
}
}
}
}
The the provider gets to
|
if schemaObj.Type.HasValue then |
and then throws because
schemaObj is null.
Looking higher up the callstack around
,
current.Schema is null, but it does have a 'Content' property, and that does contain a schema.
This is as far as I've got looking at it so far, will have another look next week if no one else of repo assist gets to it first.
Thanks.
Hi,
I tried pointing the provider at an OpenApi schema on a new project at work, and got a NullReferenceException from it, causing the build to fail.
Trying to minimise the issue, it looks like if I have something like
{ "openapi": "3.1.1", "info": { "title": "Testing | v1", "version": "0.2.0.0" }, "paths": { "/api/v1/catalogues/scan": { "post": { "tags": [ "Catalogue" ], "summary": "Testing", "description": "Testing", "operationId": "Scan", "parameters": [ { "name": "properties", "in": "header", "description": "header description", "content": { "application/json": { "schema": { "type": "object", "properties": { "stage-location": { "type": "string", "description": "location" }, "file-size": { "minimum": 0, "type": "integer", "format": "int64" } } } } } } ], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "string" } } } } } } } } }The the provider gets to
SwaggerProvider/src/SwaggerProvider.DesignTime/DefinitionCompiler.fs
Line 440 in 4e299fd
schemaObjis null.Looking higher up the callstack around
SwaggerProvider/src/SwaggerProvider.DesignTime/OperationCompiler.fs
Line 206 in 4e299fd
current.Schemais null, but it does have a 'Content' property, and that does contain a schema.This is as far as I've got looking at it so far, will have another look next week if no one else of repo assist gets to it first.
Thanks.