nitishm / vegeta-server

A RESTful API server for vegeta, a load testing tool written in Go.
MIT License
63 stars 17 forks source link

Create schema for attack result using https://github.com/tsenart/vegeta/blob/master/lib/target.schema.json. #3

Closed nitishm closed 5 years ago

nitishm commented 5 years ago

Currently the result/report is returned as a json string. Since the format of the result is fixed, we should use a concrete object instead.

nitishm commented 5 years ago

The swagger spec currently creates the response object to be of type https://github.com/nitishm/vegeta-server/blob/master/models/report_response.go#L16-L23, which returns the Report as a json string object.

Instead what we need is a new model defined int the swagger.yaml spec, for the Report type that uses the original json schema from the the vegeta library - https://github.com/tsenart/vegeta/blob/master/lib/target.schema.json.

Should be a straight-forward task to add this to swagger and edit the response object for the /report endpoint. https://github.com/nitishm/vegeta-server/blob/master/spec/swagger.yaml#L268-L278

I can add more context if the information isn't sufficient to get started.