laravel-swagger icon indicating copy to clipboard operation
laravel-swagger copied to clipboard

Limit response data

Open nemozar opened this issue 5 years ago • 3 comments

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

nemozar avatar Feb 05 '20 06:02 nemozar

@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 avatar May 02 '22 13:05 DenTray

@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 avatar Aug 01 '22 05:08 DenTray

image

@pirs1337 also please investigate the array unexpected displaying

DenTray avatar Aug 01 '22 10:08 DenTray

@DenTray, ready for testing

pirs1337 avatar Feb 20 '23 07:02 pirs1337

@NikitaYakovlev could you please test it?

DenTray avatar Mar 07 '23 15:03 DenTray

unexpected array display not fixed:

image

NikitaYakovlev avatar Mar 09 '23 09:03 NikitaYakovlev

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

DenTray avatar Aug 07 '23 02:08 DenTray

Released in 2.2 version

DenTray avatar Nov 07 '23 03:11 DenTray