laminas-api-tools / api-tools-documentation

Laminas API Tools API documentation module
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
6 stars 15 forks source link

Added possibility use collection query list #4

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

https://github.com/reuven770/zf-apigility-documentation/commit/023d81edd7cdd9ad5cecd35cdef80fc46a560c61

Accordingly need make changes in documentation-swagger I updated to swagger 2.0 according https://github.com/Antevenio/zf-apigility-documentation-swagger/commit/4cfbca05409143b811891e0e2e83dd50263ce8fc and made in

zf-apigility-documentation-swagger/src/Service.php

    protected function getURLQueryParameters()
    {
        $queryWhitelist = $this->service->getQueryWhitelist();
        if (count($queryWhitelist) > 0) {
            $templateQueryParameters = [];
            foreach ($queryWhitelist as $paramSegmentName) {
                $templateQueryParameters[$paramSegmentName] = [
                'in' => 'query',
                'name' => $paramSegmentName,
                'description' => 'URL parameter ' . $paramSegmentName,
                'dataType' => 'string',
                'required' => false,
                'minimum' => 0,
                'maximum' => 1,
                'defaultValue' => ''
                ];
            }
            return $templateQueryParameters;
        } else return false;

    }

Also added support swagger summary

    protected function getPathOperation(Operation $operation, $parameters)
    {

        return $this->cleanEmptyValues([
                'tags' => [$this->service->getName()],
                'description' => $operation->getDescription(),
                'summary' => $operation->getSummary(),
                'parameters' => $parameters,
                'produces' => $this->service->getRequestAcceptTypes(),
                'responses' => $this->getResponsesFromOperation($operation)
        ]);
    }

Originally posted by @reuven770 at https://github.com/zfcampus/zf-apigility-documentation/issues/61

weierophinney commented 4 years ago

https://github.com/reuven770/zf-apigility-documentation-swagger/commit/bed9409732711b49cf26be63e6ebf89edb94a1f0


Originally posted by @reuven770 at https://github.com/zfcampus/zf-apigility-documentation/issues/61#issuecomment-277083248