Hi There,
In the app builder, I set up a connection to my webapi but it only shows the checkboxes for GET Methods not POST Methods.
What am I missing?
Thanks for any help.
Best Regards,
Steve.
Hello,
After an investigation, I have found a forum thread where similar issue has been discussed:
AppBuilder: When adding REST-api the endpoints are disabled and not selectable | Infragistics Forums
As it is mentioned there, Results.Ok() is an old method and loses all the type information that Swagger (OpenAPI) needs to produce the correct metadata and App Builder to be able to "see" the return types.
So you need to use either:
- Return Task<YourResponseType>, where OK is assumed.- Return TypedResult.Ok(yourResponse), where OK is explicit.
If you require any further assistance on the matter, please let me know.
Sincerely,Teodosia HristodorovaSoftware Developer
Hi Teodosia,
Please see the attached image for my method for adding / post.
Thanks for the help.
I have been looking into your question and what I can say is that currently, AppBuilder only supports endpoints returning array or object. Endpoints that are described to return primitive types (or are lacking description of the return type) are being greyed out.
You can check the definition file, search for the endpoints, and see what is their description of the `response` object. If it is missing, you may try adding a response object:
``` "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Employee" } } } } } } ``` "$ref": "#/components/schemas/Employee" should point to an entry within the components property:
``` components: { schemas: { Employee: { type: "object", properties: { id: { type: "string", format: "uuid" }, name: { type: "string", nullable: true }, email: { type: "string", nullable: true }, phone: { type: "integer", format: "int64" } }, additionalProperties: false } ```
Please keep in mind that these are only examples and you need to check your OpenAPi definition file, and try to fix it.
If the issue is still reproducible, please send your source, so we could investigate this further.
Looking forward to hearing from you.