-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Do you know what the flying f**** comes through your API? Find out with this proposal!
Have wiretap live as a proxy and it will build an OpenAPI spec for you.
Inititial proposal
- Every http request proxied will have a new endpoint added in the spec (with everything added of course). It will have its response & request data added as examples.
- Any time the same endpoint encounters a different shape of data coming into the same endpoint, it will add the
oneOfstatement. - Any time the same endpoint encounters the same shape of data, it will simply add another example.
Architecture
create NewSpecGeneratorService() and have wiretap build an OpenAPI spec for you as a proxy. It will send the built spec to the UI
The UI
Want to include a button on top that opens the generated spec in a drawer.
Out of scope
I do not plan on optimizing the spec.
- if there are multiple endpoints which return the same datatype, you can consolidate them into one datatype.
Questions
Vacuum fits in here somehow. Don't know how yet.
For part 3 of the initial proposal, I would love to include oneOf on the schema level & oneOf on the data type level
but don't know how to differentiate. (this is more so something I need to figure out myself)
In Scope
The initial proposal is all in scope. Of course, it will be fully tested so you can see exactly what I mean
Comments
This is all I need. Havent thought of anything more since I just thought of this today. Will come back and add on.