Giter VIP home page Giter VIP logo

Comments (8)

pietervogelaar avatar pietervogelaar commented on August 30, 2024

Hi, do you already have an idea when this will become available?

from swagger-php.

zircote avatar zircote commented on August 30, 2024

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.

pietervogelaar avatar pietervogelaar commented on August 30, 2024

Okay I understand, I will wait patiently! :) I'm in particular waiting for #16.

from swagger-php.

zircote avatar zircote commented on August 30, 2024

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.

steffkes avatar steffkes commented on August 30, 2024

Just a quick note after having the first short look:

  • afaik parameters and operations should always be a list of objects, if you specify just one parameter or operation they are going to be represented directly, resulting in parameters or operations 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 whole registry 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.

zircote avatar zircote commented on August 30, 2024

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.

steffkes avatar steffkes commented on August 30, 2024

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.

zircote avatar zircote commented on August 30, 2024

Release 0.4.0 Complete and merged

from swagger-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.