Oh wow, my email client showed your email in a truncated way, so i didn't see you were already using my project, sorry for the silly response.
It would be possible to add external type definitions to oapi-codegen, I believe. I'm in the process of thinking about a v2 version which is more stable, and less convoluted. V1 was a learning experience. On Fri, Sep 4, 2020 at 10:56 AM Marcin Romaszewicz <marc...@gmail.com> wrote: > Have you considered reversing the workflow? You write the OpenAPI spec, > and have a code generator produce the Schemas and server boilerplate? > > If that's ok, check out my project :) > https://github.com/deepmap/oapi-codegen > > We successfully use it for many API's in production. > > -- Marcin > > > On Thu, Sep 3, 2020 at 12:06 AM Johann Höchtl <johann.hoec...@gmail.com> > wrote: > >> >> Hi, >> I would like to accomplish the following: >> >> An existing golang package on github provides a struct definition I am >> interested in to be used as part of a REST API interface I design >> >> 1. I would like to automatically go generate json schema for this >> struct >> 2. I would like to incorporate this generated schema into an OpenAPI >> definition and generate go boilerplate for that >> >> >> For step 2 I am using https://github.com/deepmap/oapi-codegen which >> works great. It also supports $ref to external schemas. >> >> Still looking to accomplish step 1: I am searching for a tool which go >> generates JSON schema from a golang source file or package. Any help? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/f0e099de-7008-478d-ba92-f2febd0c40bdn%40googlegroups.com >> <https://groups.google.com/d/msgid/golang-nuts/f0e099de-7008-478d-ba92-f2febd0c40bdn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29Lu708Gv1zZhXU3T8trxLOQs1jv8KSLWX9VaVN7_3bgD4Q%40mail.gmail.com.