Skip to content

Commit

Permalink
experimental fix for go-openapi#145
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic BIDON <[email protected]>
  • Loading branch information
fredbi committed Dec 1, 2023
1 parent 95bb41d commit ce7ad70
Show file tree
Hide file tree
Showing 7 changed files with 510 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:

- run: go test -v -race -coverprofile="coverage-${{ matrix.os }}.${{ matrix.go_version }}.out" -covermode=atomic ./...

- run: go test -v -run 145
name: repro test
env:
SWAGGER_DEBUG: '1'

- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
Expand All @@ -48,3 +53,4 @@ jobs:
os: '${{ matrix.os }}'
fail_ci_if_error: false
verbose: true

103 changes: 103 additions & 0 deletions fixtures/bugs/145/Program Files (x86)/AppName/todos.common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "To-do Demo",
"description":
"### Notes:\n\nThis OAS2 (Swagger 2) specification defines common models and responses, that other specifications may reference.\n\nFor example, check out the user poperty in the main.oas2 todo-partial model - it references the user model in this specification!\n\nLikewise, the main.oas2 operations reference the shared error responses in this common specification.",
"contact": {
"name": "Stoplight",
"url": "https://stoplight.io"
},
"license": {
"name": "MIT"
}
},
"host": "example.com",
"securityDefinitions": {},
"paths": {},
"responses": {
"401": {
"description": "",
"schema": {
"$ref": "#/definitions/error-response"
},
"examples": {
"application/json": {
"status": "401",
"error": "Not Authorized"
}
}
},
"403": {
"description": "",
"schema": {
"$ref": "#/definitions/error-response"
},
"examples": {
"application/json": {
"status": "403",
"error": "Forbbiden"
}
}
},
"404": {
"description": "",
"schema": {
"$ref": "#/definitions/error-response"
},
"examples": {
"application/json": {
"status": "404",
"error": "Not Found"
}
}
},
"500": {
"description": "",
"schema": {
"$ref": "#/definitions/error-response"
},
"examples": {
"application/json": {
"status": "500",
"error": "Server Error"
}
}
}
},
"definitions": {
"user": {
"title": "User",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The user's full name."
},
"age": {
"type": "number",
"minimum": 0,
"maximum": 150
},
"error": {
"$ref": "#/definitions/error-response"
}
},
"required": ["name", "age"]
},
"error-response": {
"type": "object",
"title": "Error Response",
"properties": {
"status": {
"type": "string"
},
"error": {
"type": "string"
}
},
"required": ["status", "error"]
}
}
}
Loading

0 comments on commit ce7ad70

Please sign in to comment.