diff --git a/CHANGELOG b/CHANGELOG index 97bd3d4260..ae07be1eeb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -71,6 +71,8 @@ v3.2.alpha1 (2017-02-05) * more detailed stacktraces in Foxx apps +* add support for Swagger tags in Foxx + v3.1.12 (XXXX-XX-XX) -------------------- diff --git a/Documentation/Books/Manual/Foxx/Router/Endpoints.mdpp b/Documentation/Books/Manual/Foxx/Router/Endpoints.mdpp index 940660382c..bfe60cce0e 100644 --- a/Documentation/Books/Manual/Foxx/Router/Endpoints.mdpp +++ b/Documentation/Books/Manual/Foxx/Router/Endpoints.mdpp @@ -372,3 +372,30 @@ Returns the endpoint. router.get(/* ... */) .deprecated(); ``` + + +tag +--- + +`endpoint.tag(...tags): this` + +Marks the endpoint with the given tags that will be used to group related routes in the generated API documentation. + +If the endpoint is a child router, all routes of that router will also be marked with the tags. If the endpoint is a middleware, this method has no effect. + +This method only affects the generated API documentation and has not other effect within the service itself. + +**Arguments** + +* **tags**: `string` + + One or more strings that will be used to group the endpoint's routes. + +Returns the endpoint. + +**Examples** + +```js +router.get(/* ... */) +.tag('auth', 'restricted'); +``` diff --git a/Documentation/Books/Manual/ReleaseNotes/NewFeatures32.mdpp b/Documentation/Books/Manual/ReleaseNotes/NewFeatures32.mdpp index 65c8df5425..083bbf9170 100644 --- a/Documentation/Books/Manual/ReleaseNotes/NewFeatures32.mdpp +++ b/Documentation/Books/Manual/ReleaseNotes/NewFeatures32.mdpp @@ -59,4 +59,6 @@ Foxx The [cookie session transport](../Foxx/Sessions/Transports/Cookie.md) now supports all options supported by the [cookie method of the response object](../Foxx/Router/Response.md#cookie). -It's now possible to provide your own version of the `graphql-sync` module when using the [GraphQL extensions for Foxx](../Foxx/GraphQL.md) by passing a copy of the module using the new _graphql_ option. \ No newline at end of file +It's now possible to provide your own version of the `graphql-sync` module when using the [GraphQL extensions for Foxx](../Foxx/GraphQL.md) by passing a copy of the module using the new _graphql_ option. + +Endpoints can now be tagged using the [tag method](../Foxx/Router/Endpoints.md#tag) to generate a cleaner Swagger documentation.