Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4056

Unable to generate REST interfaces in Go for OpenAPI v3 using oapi-codegen

$
0
0

Is there a way to use tags (or another method) to generate interfaces in Go using oapi-codegen? I've tried:

paths:  /foobar:    post:      tags:        - FooInterface      operationId: createFoo      requestBody:        content:          application/json:            schema:              $ref: '#/components/schemas/Foo'      responses:        201:          content:            application/json:              schema:                $ref: '#/components/schemas/Foo'

Also:

tags:  - name: foo    description: Operations about foo    x-oapi-codegen-server-interface-tag: FooInterface  - name: bar    description: Operations about bar    x-oapi-codegen-server-interface-tag: BarInterface

but without any luck. Instead oapi-codgen generates a single "ServerInterface", necessitating implementation of a single controller.


Viewing all articles
Browse latest Browse all 4056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>