RonasIT / laravel-swagger

Laravel-Swagger is a fully automate tool which allows to generate and save swagger-based documentation after successful completing your application's feature tests.
https://ronasit.com
MIT License
150 stars 43 forks source link

Limit response data #20

Closed nemozar closed 1 year ago

nemozar commented 4 years ago

API rerutn list with many items. In test use asserts:

assertJsonStructure([
                [
                    "fio",
                    "login",
                    "validbefore"
                    ]
                ]

in documents generated list with all items.

  1. How i can set limit response data?
  2. How i can set response model with custom example value? In annotations not finded how set different response than real api
DenTray commented 2 years ago

@nemozar the main idea of this package is to automate the collection of documentation as much as possible, so the response example generating from your test cases. You can use small trick to minimize response: just write test with the minimal response size to the last order (package save only latest response example in the doc).

As a feature request, we may implement some limit config to define the max count of records in the test examples.

DenTray commented 2 years ago

@pirs1337 could you please proceed with solution I described above? Let's add the config which will set the response example limit (please note that for the paginated data it should affect on the data field).

Also please proceed the exceptions length, in new Laravel versions it looks huge.

DenTray commented 2 years ago

image

@pirs1337 also please investigate the array unexpected displaying

pirs1337 commented 1 year ago

@DenTray, ready for testing

DenTray commented 1 year ago

@NikitaYakovlev could you please test it?

NikitaYakovlev commented 1 year ago

unexpected array display not fixed:

image

DenTray commented 1 year ago

@NikitaYakovlev thanks! seems it swagger viewer issue, it works fine with elements and rapidoc viewer

DenTray commented 1 year ago

Released in 2.2 version