Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Added possibility use collection query list #61

Open
reuven770 opened this issue Feb 2, 2017 · 2 comments
Open

Added possibility use collection query list #61

reuven770 opened this issue Feb 2, 2017 · 2 comments

Comments

@reuven770
Copy link

reuven770@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)
        ]);
    }
@reuven770
Copy link
Author

thomascube pushed a commit to thomascube/zf-apigility-documentation that referenced this issue May 2, 2019
- Create field definitions with key `query` from `collection_query_whitelist` options (issue zfcampus#61)
- Pass values from `documentation.config.php` to Api and Service models for use in custom writers (e.g. Swagger)
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-documentation; a new issue has been opened at laminas-api-tools/api-tools-documentation#4.

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

No branches or pull requests

2 participants