-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic when using API gateway #22
Comments
This is a silly bug introduced by me, rushing another feature out of the door, breaking the base use-case of the tool. I apologize for this! Breaking my own rules of high quality. It's been fixed in v |
Resolved in |
Hey, thanks for the tool - it's really promising! I'm using 0.0.20 now, using defaults, and I too am gettic a panic:
If that's not enough I can try to provide some basic OAS file to test against it. I'm running the app on Apple Silicon inside a docker container |
Thank you for finding this! and thank you for being an early tester. If you could supply the openapi spec, it would be super helpful, thank you! Also the reason the UI is messed up, is because the response never came in and the UI does not know how to handle it yet, than you for finding this. |
Sure! I'm going to be off for a week and I don't think I'll make it before I leave, but I'll try to provide you with some simplified reproduction file :) |
If that makes any difference, I'm using Prism Mock server as a target API, but I think that wouldn't really matter as wiretap is in front of it? |
This should be resolved, I tried this spec with the latest build and no panics or errors were felt. |
Not sure what this might be about then, I'm running on MacOS (M1 Max) within docker ( Using the very same OAS spec I shared above, when runing: And making some get requests to I still end up with:
I'm running |
OK Thanks, I am re-investigating this issue! |
No guarantee the type will be set on an invalid schema, so added a fallback check. Signed-off-by: Dave Shanley <dave@quobix.com>
No guarantee the type will be set on an invalid schema, so added a fallback check. Signed-off-by: Dave Shanley <dave@quobix.com>
Would you be able to try |
Hmm I'm still having issues with the same yaml provided earlier, but I think the error trace is different.. (different goroutine) I don't know go so can't really read this. Running this exactly in the same way as mentioned above.
Other Case (I've removed invalid API.yamlopenapi: 3.0.0
paths:
/v1.0/sessions:
get:
operationId: SomeID
summary: XXX
description: >-
XXX
parameters:
- name: order
required: false
in: query
schema:
default: ASC
enum:
- ASC
- DESC
type: string
- name: sort
required: false
in: query
schema:
default: id
enum:
- createdAt
- updatedAt
- id
- someId2
- someId3
- someId1
- someId4
- someId5
- propertyX
- propertyL
- propertyC
- propertyT
- connectionTime
- terminated
type: string
- name: pageNumber
required: false
in: query
description: Integer representing a page number to show
examples:
"1":
value: 1
"2":
value: 2
"3":
value: 3
"4":
value: 4
"5":
value: 5
schema:
minimum: 1
format: int32
default: 1
type: number
- name: pageSize
required: false
in: query
description: Integer representing a size of a single page
examples:
"1":
value: 1
"5":
value: 5
"10":
value: 10
"20":
value: 20
"50":
value: 50
schema:
minimum: 1
maximum: 50
format: int32
default: 10
type: number
- name: environment
required: false
in: query
description: filter environment params
style: deepObject
explode: true
schema:
$ref: "#/components/schemas/SessionEnvironmentFilterDto"
- name: period
required: false
in: query
description: filters sessions by connectionTime
style: deepObject
explode: true
schema:
$ref: "#/components/schemas/SessionsFromPeriodFilterDto"
responses:
"200":
description: Successfully received session list
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/PageDto"
- properties:
results:
type: array
items:
$ref: "#/components/schemas/SessionDto"
2XX: &a5
description: ""
3XX: &a6
description: ""
4XX: &a7
description: ""
tags: &a8
- Sessions
info:
title: XXX
description: >-
### XXX
version: 1.3.0
contact:
name: Wojtek Połowniak
url: ""
email: wojciech.polowniak@mail.com
tags: []
servers:
- url: https://server.local
components:
securitySchemes:
bearer:
scheme: bearer
bearerFormat: JWT
type: http
schemas:
SessionsFromPeriodFilterDto:
type: object
properties:
from:
type: string
description: ISO Date
format: date-time
to:
type: string
description: ISO Date
format: date-time
SessionEnvironmentFilterDto:
type: object
properties:
propertyX:
type: string
description: Alpha-2 representation of the country of origin
someId2:
type: number
description: some id 2
format: int32
brandId:
type: number
description: someId4
format: int32
someId1:
type: number
description: id
format: int32
PageMetaDto:
type: object
properties:
pageNumber:
type: number
description: Integer representing a page number to show
format: int32
minimum: 1
default: 1
pageSize:
type: number
description: Integer representing a size of a single page
format: int32
minimum: 1
maximum: 50
default: 10
itemCount:
type: number
description: Integer representing a total number of items
format: int32
pageCount:
type: number
description: Integer representing a total number of pages
format: int32
hasPreviousPage:
type: boolean
description: Boolean representing whether there is a previous page relative to
the current one
format: int32
hasNextPage:
type: boolean
description: Boolean representing whether there is a next page relative to the
current one
format: int32
required:
- pageNumber
- pageSize
- itemCount
- pageCount
- hasPreviousPage
- hasNextPage
PageDto:
type: object
properties:
results:
type: array
items:
type: array
meta:
$ref: "#/components/schemas/PageMetaDto"
required:
- results
- meta
SessionDto:
type: object
properties:
socketId:
type: string
description: Socket.io client UUID
someId2:
type: number
description: game id
format: int32
someId3:
type: number
description: link id
format: int32
someId1:
type: number
description: id
format: int32
someId4:
type: number
description: someId4
format: int32
someId5:
type: string
description: Unique string identifying the user
propertyX:
type: string
description: some property
propertyL:
type: string
description: some property
propertyC:
type: string
description: some property
propertyT:
type: number
description: some proeprty
format: int32
connectionTime:
format: date-time
type: string
description: ISO date
terminated:
type: boolean
description: definition
required:
- socketId
- someId2
- someId3
- someId1
- someId4
- someId5
- propertyX
- propertyL
- propertyC
- propertyT
- connectionTime
- terminated
Basically after hitting wiretap proxy server on I've been trying a bunch of things and I don't think I'll be able to debug it further myself 😞 |
This is very helpful, thank you for playing whack a mole with me! |
My mistake was not publishing the code where the fix was made. The fix was made in https://github.com/pb33f/libopenapi-validator, and the dependencies have been updated in Thank you for your patience. |
Works perfectly now! Thank you :) I'll definitely keep an eye on the project and report issues if I spot any :) Cheers |
Thank you for helping me make better software! |
Hi there. Wiretap is panicing when I attempt to access the API gateway URL. I am running version 0.0.18 on Linux x86-64 bit.
I invoked the program with:
Wiretap starts up as expected with:
Accessing http://localhost:9091/ gives me the below page:
However, accessing http://localhost:9090/ results in an error:
...and in the terminal:
The text was updated successfully, but these errors were encountered: