-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
Description
For other languages, the generated method is annotated with @Deprecated to inform the developer that this method (or in this case: REST endpoint) is deprecated and will be removed soon.
For this purpose, Dart supports two annotations:
- @deprecated which is taking a mandatory parameter to describe since when this method is deprecated.
- @deprecated which doesn't require any parameters or imports.
Because of the fact that the Swagger data model doesn't provide us any information since when a REST endpoint is marked as deprecated, we could at least choose the second option so the client developer can react on the deprecation.
Swagger-codegen version
2.4.14
Swagger declaration file content or url
Command line used for generation
Both executed in https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen:
mvn clean package./bin/dart-petstore.sh
Steps to reproduce
- Use the Dart Petstore sample.
- Check file https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml : it contains the deprecated REST endpoint
GET /pet/findByTags. - Execute ./bin/dart-petstore.sh to generate the Dart Swagger client.
- Check the locally generated file
swagger-codegen/samples/client/petstore/dart/swagger/lib/api/pet_api.dartin which the methodfindPetsByTags(List<String> tags)isn't marked as deprecated.
Related issues/PRs
Pull Request: #10324
Suggest a fix/enhancement
I'll extend the api.mustache file for Dart in a separate Pull Request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels