Skip to content

Swashbuckle/Swagger integration #27

Description

@JamesCrann

Hi,

I am having great success in using hybrid model binding to bind from route and body to a single model.
However the downside is that swashbuckle no longer functions correctly when generating swagger documentation.

public class AddOrUpdatePhoneNumbersRequest
    {
        [HybridBindProperty(Source.Route)]
        public string PersonId { get; set; }

        [HybridBindProperty(Source.Body)]
        public string Mobile { get; set; }

        [HybridBindProperty(Source.Body)]
        public string Home { get; set; }

        [HybridBindProperty(Source.Body)]
        public string Work { get; set; }

        [HybridBindProperty(Source.Body)]
        public PhoneNumberType PreferredPhoneNumberType { get; set; }
    }

Instead of the document example being displayed we just see the empty {} - also noting that the body thinks its coming from the query

image

Has anybody previously looked at adding a swashbuckle filter to correctly display the properties bound on the body?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions