zfcampus / zf-apigility-documentation

BSD 3-Clause "New" or "Revised" License
12 stars 34 forks source link

Added possibility use collection query list #61

Open reuven770 opened 7 years ago

reuven770 commented 7 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)
        ]);
    }
reuven770 commented 7 years ago

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

weierophinney commented 4 years ago

This repository has been closed and moved to laminas-api-tools/api-tools-documentation; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-documentation/issues/4.