Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions configuration-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@
"yaml-tags": {
"type": "boolean",
"description": "Enable the generation of YAML tags for struct fields"
},
"client-response-bytes-function": {
"type": "boolean",
"description": "Enable the generation of a `Bytes()` method on response objects for `ClientWithResponses`"
}
}
},
Expand Down
47 changes: 47 additions & 0 deletions internal/test/issues/issue240/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
openapi: "3.0.0"
info:
version: 1.0.0
title: Generate models
paths:
/client:
get:
operationId: getClient
responses:
200:
content:
application/json:
schema:
$ref: "#/components/schemas/ClientType"
put:
operationId: updateClient
responses:
400:
content:
application/json:
schema:
type: object
properties:
code:
type: string
required:
- code
components:
schemas:
ClientType:
type: object
required:
- name
properties:
name:
type: string
# NOTE that this is not generated by default because it's not referenced. If you want it, you need to use the following YAML configuration:
#
# output-options:
# skip-prune: true
Unreferenced:
type: object
required:
- id
properties:
id:
type: int
8 changes: 8 additions & 0 deletions internal/test/issues/issue240/cfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# yaml-language-server: $schema=../../../../configuration-schema.json
package: issue240
output: client.gen.go
generate:
models: true
client: true
output-options:
client-response-bytes-function: true
Loading