Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated README for new functionality

  • Loading branch information...
commit bea160a4cf69fd31894d4334c61a6f75417afd08 1 parent bcd37d5
@baldurrensch baldurrensch authored
Showing with 49 additions and 0 deletions.
  1. +49 −0 README.md
View
49 README.md
@@ -102,6 +102,47 @@ The following properties are available:
* `input`: the input type associated to the method, currently this supports Form Types, and classes with JMS Serializer
metadata, useful for POST|PUT methods, either as FQCN or as form type (if it is registered in the form factory in the container)
+* `responseCodes`: an array of HTTP response codes and a description of when that response is returned; Example:
+
+``` php
+<?php
+
+class YourController
+{
+ /**
+ * @ApiDoc(
+ * responseCodes={
+ * 200="Returned when successful",
+ * 403="Returned when the user is not authorized to say hello"},
+ * )
+ */
+ public function myFunction()
+ {
+ // ...
+ }
+}
+```
+
+* `include`: filename of a markdown formatted file to be included for longer documentation; This is relative to the path defined in the configuration section (nelmio_api_doc.include.location), i.e.
+
+``` php
+<?php
+
+class YourController
+{
+ /**
+ * @ApiDoc(
+ * include="Acme/HelloBundle/Resources/doc/myFunction.md"
+ * )
+ */
+ public function myFunction()
+ {
+ // ...
+ }
+}
+```
+This would try to include the file located at (nelmio_api_doc.include.location)/Acme/HelloBundle/Resources/doc/myFunction.md for a long description.
+
Each _filter_ has to define a `name` parameter, but other parameters are free. Filters are often optional
parameters, and you can document them as you want, but keep in mind to be consistent for the whole documentation.
@@ -196,6 +237,14 @@ input is used, so you can configure their priorities via container tags. Here's
tags:
- {name: nelmio_api_doc.extractor.parser, priority: 2}
+If you want to include a markdown file with long descriptions, you have to set the include `basepath`:
+
+ # app/config/config.yml
+ nelmio_api_doc:
+ include:
+ location: %kernel.root_dir%/../src/
+
+
## Credits ##
The design is heavily inspired by the [swagger-ui](https://github.com/wordnik/swagger-ui) project.
Please sign in to comment.
Something went wrong with that request. Please try again.