Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Incorrectly generated metadata for arrays in Swagger for .NET Core with OData #496

Copy link
Copy link
Closed
@Lonli-Lokli

Description

@Lonli-Lokli
Issue body actions

Im on 3.0 version,

  1. Add this code to Functions controller
        [HttpGet]
        [ODataRoute( nameof( CountThem ) + "(Vars={vars})" )]
        [ProducesResponseType( typeof( int ), Status200OK )]
        public IActionResult CountThem( [FromODataUri] string[] vars ) => Ok( vars.Length );

And this code to AllConfigurations
builder.Function( "CountThem" ).Returns<int>().CollectionParameter<string>( "Vars" );

  1. Run Swagger
  2. Add multiple parameters line by line
  3. Press Execute

Generated url errors with 404. It looks like this
http://localhost:59918/api/CountThem(Vars={vars})?vars=111&vars=222

While for OData with Parameter Alisases this url should look like this
http://localhost:59918/api/CountThem(Vars=@vars)?@vars=[%27111%27,%27222%27]
or
http://localhost:59918/api/CountThem(Vars=[%27111%27,%27222%27])

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.