OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.42k stars 6.48k forks source link

[REQ][Dart] dioNext: Add documentation for API parameters #9547

Closed mzdm closed 3 years ago

mzdm commented 3 years ago
openapi-generator version

openapi generator 5.1.1

OpenAPI declaration file content or url

https://cloud.ibm.com/apidocs/visual-recognition/visual-recognition-v3.json

Generation Details

-

related generated file: /api/general_api.dart

Expected: Some kind of documentation above the method.

in python:

    def classify(self,
                 *,
                 images_file: BinaryIO = None,
                 images_filename: str = None,
                 images_file_content_type: str = None,
                 url: str = None,
                 threshold: float = None,
                 owners: List[str] = None,
                 classifier_ids: List[str] = None,
                 accept_language: str = None,
                 **kwargs) -> DetailedResponse:
        """
        Classify images.

        Classify images with built-in or custom classifiers.

        :param BinaryIO images_file: (optional) An image file (.gif, .jpg, .png,
               .tif) or .zip file with images. Maximum image size is 10 MB. Include no
               more than 20 images and limit the .zip file to 100 MB. Encode the image and
               .zip file names in UTF-8 if they contain non-ASCII characters. The service
               assumes UTF-8 encoding if it encounters non-ASCII characters.
               You can also include an image with the **url** parameter.
        :param str images_filename: (optional) The filename for images_file.
        :param str images_file_content_type: (optional) The content type of
               images_file.

Actual: dioNext

  /// Classify images
  ///
  /// Classify images with built-in or custom classifiers.
  Future<Response<ClassifiedImages>> classify({ 
    required String version,
    String? acceptLanguage,
    Uint8List? imagesFile,
    String? url,
    double? threshold,
    BuiltList<String>? owners,
    BuiltList<String>? classifierIds,
    CancelToken? cancelToken,
    Map<String, dynamic>? headers,
    Map<String, dynamic>? extra,
    ValidateStatus? validateStatus,
    ProgressCallback? onSendProgress,
    ProgressCallback? onReceiveProgress,
  }) async {
    final _path = r'/v3/classify';
    final _options = Options(
      method: r'POST',
      headers: <String, dynamic>{
        if (acceptLanguage != null) r'Accept-Language': acceptLanguage,
...
kuhnroyal commented 3 years ago

Can you please check if my recent PR #9584 solves your needs.

mzdm commented 3 years ago

Tested it locally, and it looks awesome now. Thank you! image