Skip to content

Intentional Limitations

fonlow edited this page Feb 2, 2024 · 5 revisions

OpenApiClientGen follows the tradition or intention of WebApiClientGen: focus on strongly typed data only. For API functions, focus on the 200 response on content format "application/json", while ignoring the others. Therefore, application programmers might still need to read the YAML file to handle non-200 responses and non json data, depending on the overall business logics and UX design.

Please check Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators

Non application/json content

If the OpenAPI definitions contains API functions with mostly non application/json content in RequestBodies or responses or parameters, OpenApiClientGen is not for you. However, if only a handful of functions deal with non application/json content and most are with strongly typed JSON data, you may manually remove respective functions from the generated codes, and write your app codes to deal with non application/json content.

Remarks:

  • You may upvote: #54
  • Some API definitions support only text/xml response, and this is not supported, though the code gen won't report error, however, the generated codes won't be usable when talking to the backend.

Dynamic Object

    collections_add_metadataBody:
      content:
        application/json:
          schema:
            example:
              application/json:
                data:
                  attributes:
                    guid: test0
                    subjects: 5fd228b7e64e1300aa99ee15
                    volume: test
                  type: collected-metadata
            type: object
      required: true