Comments (8)
Hi, do you already have an idea when this will become available?
from swagger-php.
it is not far from complete #0.4.0-doctrine-annotations however I have been and will be very busy with my day job, until that clears up a bit I will not be able to address this. That said I am hoping in 2-3 weeks max.
from swagger-php.
Okay I understand, I will wait patiently! :) I'm in particular waiting for #16.
from swagger-php.
SHA: 64a30eee17663fd6077f003ff86f83a7d5e43dc8 is the current progression, it still needs some work on tests, cleaning things up a bit. That said I am interested in comments and thoughts before I close in on merging it in the next 2-3 weeks.
from swagger-php.
Just a quick note after having the first short look:
- afaik
parameters
andoperations
should always be a list of objects, if you specify just oneparameter
oroperation
they are going to be represented directly, resulting inparameters
oroperations
to be a hash -- to fix this, i enforced$this->value
to be an array, which looked good at least for the first test - at your test (which i had a look at because of
PHP Fatal error: Call to undefined method Swagger\Swagger::getResourceNames() in swagger-php/bin/swagger on line 121
) you're encoding the wholeregistry
which results in one big structure, but swagger-ui needs several parts for the resources .. or did i miss there something?
If i can help you somewhere, please let me know and i'll see what i can do :)
from swagger-php.
Think I got the resources nailed down now, I plan to work on the model support now as well as cleaning up what I have with the code so far. Still a ways to go yet, using the example json documents for the swagger site as my test case and validation. @steffkes I have not spent any time yet on the phar/cli and won't until I get this stabilized at which point I plan to also address caching as well.
{
"apiVersion":"0.2",
"swaggerVersion":"1.1",
"basePath":"http://petstore.swagger.wordnik.com/api",
"resourcePath":"/pet",
"apis":[
{
"path":"/pet.{format}/{petId}",
"description":"Operations about pets",
"operations":[
{
"nickname":"getPetById",
"responseClass":"Pet",
"summary":"Find pet by ID",
"httpMethod":"GET",
"parameters":[
{
"description":"ID of pet that needs to be fetched",
"allowMultiple":false,
"dataType":"string",
"name":"petId",
"paramType":"path",
"required":true
}
],
"errorResponses":[
{
"code":"400",
"reason":"Invalid ID supplied"
},
{
"code":"404",
"reason":"Pet not found"
}
],
"notes":"Returns a pet based on ID"
}
]
},
{
"path":"/pet.{format}",
"description":"Operations about pets",
"operations":[
{
"nickname":"addPet",
"responseClass":"void",
"summary":"Add a new pet to the store",
"httpMethod":"POST",
"parameters":[
{
"description":"Pet object that needs to be added to the store",
"allowMultiple":false,
"dataType":"Pet",
"paramType":"body",
"required":true
}
],
"errorResponses":[
{
"code":"405",
"reason":"Invalid input"
}
]
},
{
"nickname":"updatePet",
"responseClass":"void",
"summary":"Update an existing pet",
"httpMethod":"PUT",
"parameters":[
{
"description":"Pet object that needs to be updated in the store",
"allowMultiple":false,
"dataType":"Pet",
"paramType":"body",
"required":true
}
],
"errorResponses":[
{
"code":"400",
"reason":"Invalid ID supplied"
},
{
"code":"404",
"reason":"Pet not found"
},
{
"code":"405",
"reason":"Validation exception"
}
]
}
]
},
{
"path":"/pet.{format}/findByStatus",
"description":"Operations about pets",
"operations":[
{
"nickname":"findPetsByStatus",
"responseClass":"List[Pet]",
"summary":"Finds Pets by status",
"httpMethod":"GET",
"parameters":[
{
"description":"Status values that need to be considered for filter",
"allowMultiple":true,
"dataType":"string",
"name":"status",
"paramType":"query",
"required":true,
"defaultValue":"available",
"allowableValues":{
"valueType":"LIST",
"values":[
"available",
"pending",
"sold"
]
}
}
],
"errorResponses":[
{
"code":"400",
"reason":"Invalid status value"
}
],
"notes":"Multiple status values can be provided with comma seperated strings"
}
]
}
from swagger-php.
I have not spent any time yet on the phar/cli and won't until I get this stabilized at which point I plan to also address caching as well.
Don't get me wrong, that's completely fine - had only a quick look and wondered how we would be able the generate the typical resources
files? iterating over the registry to get the details for each specific resource is fine, but the global one?
For a large(r) Codebase Swagger#getFiles
may get a little expensive, i'll see if i can rewrite this using RecursiveDirectoryIterator
and FilterIterator
from swagger-php.
Release 0.4.0
Complete and merged
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.