Skip to content

docs: Clarify TypeScriptVersion accepts any decimal ≥ 4.3#1884

Merged
lahma merged 2 commits intomasterfrom
copilot/update-typescriptgenerator-docs
Mar 1, 2026
Merged

docs: Clarify TypeScriptVersion accepts any decimal ≥ 4.3#1884
lahma merged 2 commits intomasterfrom
copilot/update-typescriptgenerator-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

TypeScriptVersion had an ambiguous doc comment that implied it might only accept specific predefined values, leading users to believe they couldn't pass their actual TypeScript version (e.g. 4.9).

Changes

  • TypeScriptGeneratorSettings.TypeScriptVersion: Updated XML doc comment to explicitly state the property accepts any decimal value ≥ 4.3 and explains that the value gates which TypeScript language features are emitted in generated code.
// Before (ambiguous)
/// <summary>Gets or sets the target TypeScript version (minimum, default: 4.3).</summary>

// After (clear)
/// <summary>Gets or sets the target TypeScript version (default: 4.3, minimum: 4.3).
/// Accepts any decimal version number greater than or equal to 4.3 (e.g. 4.3, 4.9, 5.0).
/// The version is used to determine which TypeScript language features are available and may be used in the generated code.</summary>
Original prompt

This section details on the original issue you should resolve

<issue_title>Documentation: TypeScriptGeneratorSettings is unclear about which typeScriptVersion is selected</issue_title>
<issue_description>My understanding is that there's only some specific typescript version that nswag supports for typeScriptVersion. However, https://github.com/RicoSuter/NJsonSchema/wiki/TypeScriptGeneratorSettings does not clearly specify which versions are valid, or how (if at all) it fallbacks to a supported version given a different version passed in.

For context: I wanted to have my nswag script automatically follow my project's current version of typescript as closely as possible.
</issue_description>

Comments on the Issue (you are @copilot in this section)

@RicoSuter Latest version of nswag/njs requires minimum of 4.3… (docs updated)

Im not even sure whether there are features which requires higher version.

But you can set it to your number and gens will react..

Though the nswagstudio uses a select a the moment with only 4.3, we should change that to be a number input</comment_new>
<comment_new>@RicoSuter

If I understand your answer correctly, I should be able to do just that (ie: if I use TS 4.9.5, I can pass in typeScriptVersion:4.9 and it's only used to see if certain features are available for TS 4.9)

Yeah i think everywhere except in studio its a decimal and this should just work</comment_new>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: lahma <171892+lahma@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for TypeScriptGeneratorSettings version clarity docs: Clarify TypeScriptVersion accepts any decimal ≥ 4.3 Mar 1, 2026
Copilot finished work on behalf of lahma March 1, 2026 19:54
@lahma lahma marked this pull request as ready for review March 1, 2026 20:00
@lahma lahma merged commit 91f41de into master Mar 1, 2026
2 checks passed
@lahma lahma deleted the copilot/update-typescriptgenerator-docs branch March 1, 2026 20:01
This was referenced Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: TypeScriptGeneratorSettings is unclear about which typeScriptVersion is selected

2 participants