Skip to content

Commit

Permalink
Merge pull request #818 from tdakkota/fix/path-parameter-escaping
Browse files Browse the repository at this point in the history
fix(gen): unescape path parameters correctly
  • Loading branch information
ernado authored Mar 16, 2023
2 parents fae338e + 125095c commit e329fad
Show file tree
Hide file tree
Showing 123 changed files with 31,591 additions and 18,738 deletions.
55 changes: 38 additions & 17 deletions _testdata/positive/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,55 @@
}
}
},
"/pathParameter/{value}": {
"get": {
"description": "Test for path param",
"operationId": "pathParameter",
"parameters": [
{
"name": "value",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Returns path value",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Value"
}
}
}
}
}
}
},
"/headerParameter": {
"get": {
"description": "Test for header param",
"operationId": "headerParameter",
"parameters": [
{
"name": "X-Value",
"in": "header",
"required": true,
"name": "X-Auth-Token",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Returns sha256 of header value",
"description": "Returns header value",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Hash"
"$ref": "#/components/schemas/Value"
}
}
}
Expand All @@ -175,21 +203,21 @@
"operationId": "cookieParameter",
"parameters": [
{
"name": "value",
"in": "cookie",
"required": true,
"name": "value",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Returns sha256 of cookie value",
"description": "Returns cookie value",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Hash"
"$ref": "#/components/schemas/Value"
}
}
}
Expand Down Expand Up @@ -280,21 +308,14 @@
},
"components": {
"schemas": {
"Hash": {
"Value": {
"type": "object",
"required": [
"raw",
"hex"
"value"
],
"properties": {
"raw": {
"type": "string",
"format": "byte"
},
"hex": {
"type": "string",
"minLength": 64,
"maxLength": 64
"value": {
"type": "string"
}
}
},
Expand Down
88 changes: 60 additions & 28 deletions examples/ex_2ch/oas_client_gen.go

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

Loading

0 comments on commit e329fad

Please sign in to comment.