Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Swagger/OpenAPI schemas to show up correctly #104

Open
reinux opened this issue Feb 9, 2022 · 6 comments
Open

Getting Swagger/OpenAPI schemas to show up correctly #104

reinux opened this issue Feb 9, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@reinux
Copy link

reinux commented Feb 9, 2022

This might be a bit of an ask, but is there a chance we can get the Swagger APIs to show up for this correctly?

Currently, unions show up like:


// F#
type InvoiceIndexItem = {
  Id: InvoiceId
  InvoiceNumber: string
  Principal: PrincipalSummary
  Subtotal: decimal
  TotalAmount: decimal
}

// Json

[
  {
    "Id": {
      "Tag": 0,
      "Item": 0
    },
    "InvoiceNumber": "string",
    "Principal": {
      "id": {
        "Tag": 0,
        "Item": 0
      },
      "name": "string"
    },
    "Subtotal": 0,
    "TotalAmount": 0
  }
]
@Tarmil Tarmil added the enhancement New feature or request label Feb 10, 2022
@Tarmil
Copy link
Owner

Tarmil commented Feb 10, 2022

It is indeed a significant amount of work, but I have some experimentation that I started on this topic some time ago. I'll need to pick that up again.

@reinux
Copy link
Author

reinux commented Jul 1, 2022

Have you had a chance to look at this at all?

Would be cool to be able to use Swagger with F# for work.

Edit: Exploring some code to see if there's anything I can contribute. It looks like NSwag is a lot more straightforward than Swashbuckle.

@kaaja-h
Copy link

kaaja-h commented Nov 7, 2022

I prepared FSharp.SystemTextJson.Swagger for swagger work with FSharp.SystemTextJson.
Still lot of work to do. Especialy on union types.
Please report issues and be free to send pull requests.

@Tarmil
Copy link
Owner

Tarmil commented Nov 7, 2022

@kaaja-h Awesome, thanks! I'll be sure to check it out.

@reinux
Copy link
Author

reinux commented Nov 8, 2022

Thanks @kaaja-h!

@C0DK
Copy link

C0DK commented Jul 23, 2023

@kaaja-h awesome project! I hope you'll continue supporting it. if there is something somewhat trivial to do to help, please say so :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants