Skip to content

Commit

Permalink
Merge pull request #1246 from k4n4ry/fix/generate-free-form-object
Browse files Browse the repository at this point in the history
fix(gen): add support for Free-form Objects when a schema definitions only specifies `type: object`
  • Loading branch information
tdakkota authored May 22, 2024
2 parents bc94e89 + 1c28226 commit fd8ab3c
Show file tree
Hide file tree
Showing 73 changed files with 5,269 additions and 966 deletions.
42 changes: 42 additions & 0 deletions _testdata/positive/free_form.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"openapi": "3.0.3",
"info": {
"version": "1.0.0",
"title": "Free-Form Object Example"
},
"paths": {
"/path1": {
"get": {
"operationId": "Path1",
"responses": {
"default": {
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/path2": {
"get": {
"operationId": "Path2",
"responses": {
"default": {
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
}
}
}
}
12 changes: 6 additions & 6 deletions examples/ex_firecracker/oas_client_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions examples/ex_firecracker/oas_faker_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/ex_firecracker/oas_handlers_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fd8ab3c

Please sign in to comment.