thim81 / openapi-format

Format an OpenAPI document by ordering, formatting and filtering fields.
MIT License
80 stars 14 forks source link

Transformation of Number #52

Closed nicklloyd closed 2 years ago

nicklloyd commented 2 years ago

Hi @thim81, we've seen that latest version, specifically this commit, is affecting numbers used in escaped values.

As an example, we use a vendor extension in our specs:

      x-typescript-params: |-
        {
          id: 'id_example',
          payment: {
            currency: 'USD',
            currency_rate: 0.69,
            total_amount: 49.99,
            reference: '123456',
            payment_method: 'Credit Card',
            payment_method_reference: '123456'            
        }

Running 1.10.0 results is the following:

      x-typescript-params: |-
        {
          id: 'id_example',
          payment: {
            currency: 'USD',
            currency_rate: '0.69===',
            total_amount: '49.99===',
            reference: '123456',
            payment_method: 'Credit Card',
            payment_method_reference: '123456'            
        }

Maybe an edge case, but thought you should know

thim81 commented 2 years ago

@nicklloyd thanks for reporting. I m working on a bug fix release for some unwanted conversion. I ll include this bug since this is clearly not desired.

thim81 commented 2 years ago

This issue should be solved with the v1.10.1 release. Closing the issue.