Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Date Handling in Insomnia Collection Import #3303

Conversation

anusreesubash
Copy link
Contributor

@anusreesubash anusreesubash commented Oct 14, 2024

Importng insomnia files(yaml exports) fails when it contains date values

 url: https://testbench-sanity.usebruno.com/api/echo/json
    name: New Request
    description: ""
    method: GET
    body: {}
    parameters:
      - id: pair_87d0dc461d5a408a93ebfe0fe500fdce
        name: date
        value: 2022-22-02
        description: ""
        disabled: false
      - id: pair_8a903b8bf636404288bba577485d6816
        name: ""
        value: ""
        description: ""
        disabled: false
        

The YAML parser(js-yaml) automatically converts date values into Date objects, which causes issues while validating collection schema.

I have updated the YAML parsing logic to use the CORE_SCHEMA from js-yaml. This way, we avoid automatic conversion of date.

Issue ref to js-yaml repo: nodeca/js-yaml#161

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@anusreesubash anusreesubash marked this pull request as ready for review October 14, 2024 10:15
@helloanoop helloanoop merged commit a880e03 into usebruno:main Oct 14, 2024
2 checks passed
@helloanoop
Copy link
Contributor

Merged. Thanks @anusreesubash !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants