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

RFC Proposal: remove format restrictions #253

Closed
bravo-kernel opened this issue Oct 11, 2015 · 2 comments
Closed

RFC Proposal: remove format restrictions #253

bravo-kernel opened this issue Oct 11, 2015 · 2 comments

Comments

@bravo-kernel
Copy link
Collaborator

Please review before I create a PR.

Quoted from the 2.0 specification:

Primitives have an optional modifier property format. Swagger uses several known formats to more finely define the data type being used. However, the format property is an open string-valued property, and can have any value to support documentation needs. Formats such as "email", "uuid", etc., can be used even though they are not defined by this specification

Currently the lib is throwing notices when using non-swagger-predefined-formats:

Notice (1024): @swg\Parameter(name="id",in="path")->format "uuid" is invalid, expecting "int32", "int64", "float", "double", "byte", "date", "date-time" in \App\Controller\SwaggerController->index() in /home/vagrant/projects/my.cool.app/src/Controller/SwaggerController.php on line 30 [ROOT/vendor/zircote/swagger-php/src/Logger.php, line 38]

Caused by an in_array check against https://github.com/zircote/swagger-php/blob/master/src/Annotations/Parameter.php#L172

My suggestion would be dropping that whole array now that formats (seem to be) non restricted anyways, would you agree?

@bfanger
Copy link
Collaborator

bfanger commented Oct 18, 2015

Agreed, thanks!

@bravo-kernel
Copy link
Collaborator Author

Awesome, thanks for updating. Keep up the good work!

bfanger added a commit that referenced this issue Oct 23, 2015
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

2 participants