Skip to content

Hidi: Filtering OpenAPI spec by Postman collection fails #1342

@waldekmastykarz

Description

@waldekmastykarz

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.

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