Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public TypeScriptOperationModel(
_settings = settings;
_generator = generator;

var parameters = GetActualParameters();
var parameters = GetActualParameters().OrderBy(p => p.Position).ToList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the ToList() calls should be removed from here and below, there's no need to materialize as list as it is done at the end anyway.


if (settings.GenerateOptionalParameters)
{
parameters = parameters
.OrderBy(p => p.Position ?? 0)
.OrderBy(p => !p.IsRequired)
.ThenBy(p => !p.IsRequired)
.ToList();
}

Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.CodeGeneration.TypeScript/Templates/File.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import * as jQuery from 'jquery';
{%- endif -%}
{%- if Framework.UseMomentJS -%}

import moment from 'moment';
import * as moment from 'moment';
{%- if RequiresMomentJSDuration -%}
import 'moment-duration-format';
{%- endif -%}
Expand Down