Comments (7)
@ChristianWeyer This has been fixed and released to 1.5.2
from azurefunctions.extensions.
@ChristianWeyer Thanks for raising this issue! I'll have a look and get back to you.
from azurefunctions.extensions.
The problem also applies for list types in the OpenApiRequestBody
.
@ChristianWeyer I'd suggest to change the title of this issue to 'Type List for OpenApiPayloadAttribute not mapped correctly'.
from azurefunctions.extensions.
from azurefunctions.extensions.
I’ve excluded
JObject
andDictionary<>
from being a root level payload type, at #29. I think so does theList<>
, too.
By saying so, do you consider this issue as a missing feature/bug or being out of scope?
IMHO returning list types is a valid use case and the generated OpenApi.json should render somehow like
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Product"
}
}
}
and include a schema derived from class Product
.
from azurefunctions.extensions.
The support for List<> is part of #37.
from azurefunctions.extensions.
Sorry, this does not yet seem to work?
I am using 1.5.2 now.
The Swagger JSON now looks like this:
{
"swagger": "2.0",
"info": { },
"host": "localhost:7071",
"schemes": [
"http"
],
"paths": {
"/api/products": {
"get": {
"tags": [
"Serverless Microservices"
],
"operationId": "products",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Payload of Array of Product",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Product"
}
}
}
}
}
},
"/api/products/{id}": {
"get": {
"tags": [
"Serverless Microservices"
],
"operationId": "productbyid",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Payload of ProductDetails",
"schema": {
"$ref": "#/definitions/ProductDetails"
}
}
}
}
}
},
"definitions": {
"ProductDetails": {
"type": "object",
"properties": {
"Id": {
"format": "uuid",
"type": "string"
},
"Name": {
"type": "string"
},
"Description": {
"type": "string"
},
"OnStock": {
"type": "boolean"
}
}
}
},
"securityDefinitions": {
"authKey": {
"type": "apiKey",
"name": "x-functions-key",
"in": "header"
}
}
}
As you can see, there is no definition for Product in there.
This seems to be missing - and thus the UI breaks as well:
Any idea what could be wrong here? @justinyoo @glennular
Thanks!
from azurefunctions.extensions.
Related Issues (20)
- Get EnumMember Value HOT 1
- Generic types makes yaml definition non-compliant
- Documentation stale - OpenApiResponseBody should be OpenApiResponseWithBodyAttribute HOT 1
- ReflectionTypeLoadException when running CLI HOT 2
- An item with the same key has already been added.
- StackOverflow Exception HOT 5
- Property description added to field? HOT 3
- Updating Authorization Level and Base URL HOT 5
- Generic delimiter selector
- Can we specify our own swagger.json file? HOT 1
- Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' HOT 2
- Mark an endpoint as deprecated HOT 2
- OpenApiHttpTriggerContext.cs generates a compiler warning when using C#8 nullable reference types HOT 2
- default "Code" query string on all functions HOT 1
- Missing list item type definition HOT 2
- authentication settings HOT 2
- Resolver error for dictionary properties in swagger UI OpenApi 3.1.1 HOT 1
- FileUpload support HOT 2
- Upgrade for dependencies packages
- Support for isolated function and HttpRequestData over HttpRequest? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azurefunctions.extensions.