rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.61k stars 271 forks source link

Inconsistent data type rendering #1009

Open meyer-r opened 2 months ago

meyer-r commented 2 months ago

The representation of data types is inconsistent for path parameters and response objects:

In the following sample OpenAPI, a path parameter and a response object property are both defined with type:integer and format:int64.

Sample OpenAPI:

openapi: 3.0.1
info:
  title: demo
  version: 0.0.1
paths:
  /service/{id}:
    get:
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        200:
          description: response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    format: int64

While Rapidoc renders "int64" for the path parameters (which seems fine as int64 implies integer type), it shows "integer" for the response object property (see the following screenshot, type information marked green):

rapidoc-format-missing

This is confusing, as the user will assume that the parameter and property have different data types, which is not the case. Data type information should be rendered uniformly including format details in all places.