Skip to content

Dictionaries not supported #161

@poloBBQ

Description

@poloBBQ

Expected Behavior

Dictionary properties with string keys should generate a swagger document using object-typed additionalProperties as explained in the Swagger specification.

public Dictionary<string, int> Dictionary { get; set; }

Should output something equivalent to:

"dictionary": {"type": "object","additionalProperties": {"type": "integer","format": "int32"}}

Actual Behavior

An array is generated, which is an incorrect interpretation of a dictionary. As an example:

public Dictionary<string, int> Dictionary { get; set; }

Outputs:

"dictionary": {"type": "array","items": {"type": "string"}}

Other Information:

I forked the repo and commited a change to support dictionaries, please let me know if I should create a pull request with it or do any corrections https://github.com/evicertia/Nancy.Swagger/tree/dictionary-support

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions