Comments (12)
/**
* @SWG\Parameter(
* name="status",
* in="query",
* type="string",
* enum={"pending", "failed", "completed"}
* )
*/
Documented here and used in the petstore example here
from swagger-php.
@pakcybershagufta and everyone else:
* @OA\Parameter(
* @OA\Schema(
* default="value1",
* type="string",
* enum={
* "value1",
* "value2",
* },
* ),
* description="Value Values.",
* example="value1",
* in="query",
* name="values",
* required=true,
* ),
Creates a Select with Options, where one value must be chosen, value1
is selected by default.
from swagger-php.
Currently you can with the following example:
@property string<'Two Pigs','Duck', 'And 1 Cow'> $enumVal This is an enum value.
With the coming changes (Doctrine Annotations) it will look like:
/**
*
*
* @var string
*
* @Property(
* type="string",
* @allowableValues(
* valueType="LIST",
* values="['available', 'pending', 'sold']"
* ),
* description="pet status in the store")
*/
protected $status;
And the parameter
definition in the doctrine annotations looks like:
* @parameter(
* name="status",
* description="Status values that need to be considered for filter",
* paramType="query",
* defaultValue="available",
* @allowableValues(valueType="LIST", values="['available', 'pending', 'sold']"),
* required="true",
* allowMultiple=true,
* dataType="string"
* )
from swagger-php.
Thanks for you response. So currently I figure it's only possible to define it in a model but not as query parameter? Is that correct?
I noticed the Doctrine annotations branch, looks very nice! What's the schedule for it to merge it into the master branch?
from swagger-php.
I am hoping to be able to merge it this weekend, it is passing tests now; however I want to get a caching layer in place and perhaps a bit of refactoring if there is time and more importantly documentation of the annotations. SHA: c8b536c046fa3e0fe050a6fc5c9ce871d1be7242 I just pushed and it appears to be fully functional so far more tests would be great.
from swagger-php.
Awesome that's soon! Yeah, documentation is important I think. At the moment I find myself sometimes looking at the unit tests to see what the correct notation or options are :)
from swagger-php.
0.4.0
addresses this and is documented in further detail at http://zircote.com/swagger-php
from swagger-php.
Where this is documented? I can't find on docs.
from swagger-php.
Thanks!
from swagger-php.
/** * @SWG\Parameter( * name="status", * in="query", * type="string", * enum={"pending", "failed", "completed"} * ) */
Thank you ..great job
from swagger-php.
How set default value in enum and please tell me also how set multi select also like colors colors select multiple colors
from swagger-php.
HOw we use anyOf etc preperty exact format please?
from swagger-php.
Related Issues (20)
- The latest tag and release differ : 4.9.4 vs 4.10.0 ? HOT 1
- Unable to group HOT 9
- [Feature]: Append "tags" list via Operation attribute HOT 3
- Parameters in laravel seem a bit too troublesome HOT 4
- Improve processor reference
- Possible BC Break in 4.10.1 HOT 4
- Validation fails with repeated tags since v4.10.1 HOT 3
- Global unified configuration suggestions
- Filtering not done as expected HOT 4
- How to set deepObject properties type HOT 1
- removeAnnotation performance HOT 1
- Fatal error "Nesting level too deep - recursive dependency?" HOT 2
- Tags within api definition are not unique HOT 2
- No output on CLI HOT 1
- How to work with discriminator?
- Schema generation fails inside JsonContent HOT 2
- Schema generator add illegal request key under requestBody HOT 5
- Operation security is invalid
- Default OpenAPI Version from RootContext overwrites OpenAPI Version from OpenApi Property HOT 4
- Duplicate tags will not be filtered out HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-php.