Skip to content

Required Request Body Fields as nullable: false #3

@SeanWilken

Description

@SeanWilken

Hello falcoframework,

Thank you firstly for the hard-work and dedication you put into this project, it is greatly appreciated! We are trying to use the framework to generate documentation for a public API server we are working towards, with full documentation and the ability to test from SwaggerUI, but seem to be hitting a wall on the exposing of request body properties conveyed correctly.

We have the following type, for Greeting, where one field would be an option and the other is required. When generating the documentation, it will always state that the field is nullable when defining a simple type. The goal is to have the API docs not show any complex F# types such as wrapped options with the values represented to the end user correctly (MessageRequired shows as required in the schema definition), so that other people who want to integrate with our API can send a DTO shaped accordingly, and have the values mapped and validated on the server.

EndPoint Request Type and EndPoint handler:

Image

Configuration of Services and application:

Image

main:

Image

Produced on the frontend:

When using an optional value, the request value gets wrapped into FSharpOption with the underlying data being wrapped in an object as a value such as, with no way to control when a field in the body is required, they are always nullable when in the request body:

Image

Thank you for your time and effort! Any insights into what corrections or changes need to be made or configured would be a tremendous help!

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions