モデルのコレクションを返す典型的なRESTfulエンドポイントがありますが、生成されたRuby SDKはモデルの配列の代わりに新しいモデルMatters
を返します。私はArray<Matter>
を返すために生成されたソースコードをハックすることができますが、それはメンテナンスの頭痛です。 Array<Matter>
をYAMLに戻したいと指定するにはどうすればよいですか?闊歩codegenのか、何か他のものを使用して -SDKの応答を適切に定義するオブジェクトの配列を返す
paths:
/matters:
get:
...
responses:
200:
schema:
$ref: "#/definitions/Matters"
...
definitions:
Matter:
type: "object"
properties:
id:
type: "string"
description: "Database identifier of the object."
caseId:
type: "string"
description: "Database identifier of the Case object."
clientMatterNumber:
type: "string"
description: "Client/matter billing code."
judge:
type: "string"
description: "Initials of the presiding judge."
caseNumber:
type: "string"
description: "Canonical case number."
caseTitle:
type: "string"
description: "Canonical case title."
natureOfSuit:
type: "string"
description: "Judicial Conference designation of the case."
docketEntries:
type: "integer"
description: "The count of docket entries in the case."
activityAt:
type: "string"
format: "date-time"
description: "The time of last activity in the case. "
Matters:
description: "A collection of matters"
type: "array"
items:
$ref: "#/definitions/Matter"
をそれを考え出しましたか? – Helen
Btw、 'Matter'モデルのプロパティ定義は無効です。スペックをhttp://editor.swagger.ioに貼り付け、エラーを修正してください。 – Helen
Helen、yes、codegen –