Generating Empty Request + Response
mjallday opened this issue · comments
Marshall Jones commented
openapi: '3.0.0'
info:
title: Example API
paths:
/records:
post:
operationId: createRecords
tags:
- records
requestBody:
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/RecordCreateRequest'
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Record'
components:
schemas:
Record:
type: "object"
properties:
id:
type: "string"
example: RCvafeqcnYSvHLxtqAhur7MX
RecordCreateRequest:
type: "object"
properties:
value:
type: "string"
example: fooo
Gives me
syntax = "proto3";
package exampleapi;
import "google/protobuf/empty.proto";
service ExampleAPIService {
rpc CreateRecords(google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
Any idea why it's generating the input and return types as google.protobuf.Empty
?
JP Robinson commented
Sorry, this tool is only set up for the Open API v2 specification. The differences in schemas means this tool is unable to read the requestBody
field.
I could've sworn we had something in the README calling this out, but I guess I need to make an issue. 😓
Marshall Jones commented
Thanks for the info JP. I was crawling the issues and thought I saw someone using v3.