Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility use collection query list #4

Open
weierophinney opened this issue Dec 31, 2019 · 1 comment
Open

Added possibility use collection query list #4

weierophinney opened this issue Dec 31, 2019 · 1 comment

Comments

@weierophinney
Copy link
Contributor

reuven770/zf-apigility-documentation@023d81e

Accordingly need make changes in documentation-swagger
I updated to swagger 2.0 according Antevenio/zf-apigility-documentation-swagger@4cfbca0
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 zfcampus/zf-apigility-documentation#61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant