Skip to content

Commit

Permalink
Customize method name using annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Balčytis committed Mar 21, 2020
1 parent c96c361 commit 8816b50
Show file tree
Hide file tree
Showing 44 changed files with 1,117 additions and 257 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 10.7.0
### Added
- Ability to provide method name with `(generator_method_name_override)` annotation

## 10.6.1
### Fixed
- In JS package generator replaced `phar` file with `bin/console`
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Currently this utility can:
1. [types/category.raml](#raml/category/types/category.raml)
1. [types/category-result.raml](#raml/category/types/category-result.raml)
1. [traits/category-filter.raml](#raml/category/traits/category-filter.raml)
1. [Custom annotations](#custom-annotations)
1. [`(generator_method_name_override)`](#--generator-method-name-override--)
1. [Generate and publish clients](#generate-and-publish-clients)
1. [config.json format](#config.json-format)
1. [Generate Javascript REST client](#generate-javascript-rest-client)
Expand Down Expand Up @@ -176,6 +178,30 @@ properties:
type: Category
```
## Custom annotations
### `(generator_method_name_override)`

Use this to override method name (for any generated client or bundle).

For example:
```
#%RAML 1.0
title: Custom
version: 1.0
baseUri: https://my-api.example.com/rest/v1
annotationTypes:
generator_method_name_override: string
/something:
get:
(generator_method_name_override): customNameForMethod
responses:
204: ~
```

## Generate and publish clients

1. Run `bin/console release:clients {path_to_config}`.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"padraic/phar-updater": "^1.0",
"paysera/lib-changelog-parser": "^1.1.2",
"paysera/lib-dependency-injection": "^1.0",
"raml-org/raml-php-parser": "^4.3",
"raml-org/raml-php-parser": "^4.5",
"sebastian/diff": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.1.6",
Expand Down
Loading

0 comments on commit 8816b50

Please sign in to comment.