Skip to content

Hidi: Filtering OpenAPI spec by Postman collection fails #1342

Closed

Description

Describe the bug

Filtering OpenAPI spec by a Postman collection fails with the following error:

Could not transform the document, reason: Object reference not set to an instance of an object.

To Reproduce

  • Download Graph openapi.yaml
  • Create a Postman collection with some endpoint
  • hidi transform -d openapi.yaml -c collection.json --co

Expected behavior

Filtered collection

Screenshots/Code Snippets
image

Additional context
Error is caused by a null reference here:

if (!paths.ContainsKey(path))

This stems from initializing the requestUrls as null here:

Dictionary<string, List<string>> requestUrls = null;

To fix this, we'd need to instantiate requestUrls as an empty Dictionary. If you're okay with this proposal I'd be happy to submit a PR.

Activity

  1. added a commit that references this issue on Sep 14, 2023
    6814542
  2. added a commit that references this issue on Sep 14, 2023
    b6cf619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions