liubao68 commented on issue #4637:
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/4637#issuecomment-2547831570

   上述修改方案测试代码的swagger如下。 意味着在servicecomb内部使用 
`BigDecimal`和`BigInteger`之间使用是没有问题的。 但是考虑异构框架的互操作(尽管目前没有)的时候,还是会有些语义不清晰。 Open 
API `number`, `integer`类型无法表示 `BigDecimal`和`BigInteger`, 会存在精度损失。 
   
   ```
   openapi: 3.0.1
   info:
     title: swagger definition for 
org.apache.servicecomb.demo.springmvc.server.BigNumberSchema
     version: 1.0.0
   servers:
   - url: /bigNumber
   paths:
     /decimal:
       post:
         operationId: bigDecimal
         parameters:
         - name: decimalHeader
           in: header
           required: true
           schema:
             type: number
         - name: decimalQuery
           in: query
           required: true
           schema:
             type: number
         requestBody:
           content:
             application/x-www-form-urlencoded:
               schema:
                 type: object
                 properties:
                   decimalForm:
                     type: number
         responses:
           "200":
             description: response of 200
             content:
               application/json:
                 schema:
                   type: number
               application/protobuf:
                 schema:
                   type: number
               text/plain:
                 schema:
                   type: number
     /integer:
       post:
         operationId: bigInteger
         parameters:
         - name: intHeader
           in: header
           required: true
           schema:
             type: integer
         - name: intQuery
           in: query
           required: true
           schema:
             type: integer
         requestBody:
           content:
             application/x-www-form-urlencoded:
               schema:
                 type: object
                 properties:
                   intForm:
                     type: integer
         responses:
           "200":
             description: response of 200
             content:
               application/json:
                 schema:
                   type: integer
               application/protobuf:
                 schema:
                   type: integer
               text/plain:
                 schema:
                   type: integer
   components: {}
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to