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
Merged
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
2 changes: 1 addition & 1 deletion 2 Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>2.11.1</VersionPrefix>
<VersionPrefix>3.0.0</VersionPrefix>
<PackageValidationBaselineVersion>2.8.0</PackageValidationBaselineVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
Expand Down
4 changes: 4 additions & 0 deletions 4 ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

These are the NuGet package releases. See also [npm Release Notes](ReleaseNotesNpm.md).

## 3.0.0

* Support required fields as not optional in TypeScript.

## 2.11.1

* Ignore events for now.
Expand Down
12 changes: 6 additions & 6 deletions 12 conformance/src/conformanceApiTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export interface ICreateWidgetResponse {
/** Request for GetWidget. */
export interface IGetWidgetRequest {
/** The widget ID. */
id?: number;
id: number;

/** Don't get the widget if it has this ETag. */
ifNotETag?: string;
Expand Down Expand Up @@ -127,7 +127,7 @@ export interface IDeleteWidgetResponse {
/** Request for GetWidgetBatch. */
export interface IGetWidgetBatchRequest {
/** The IDs of the widgets to return. */
ids?: number[];
ids: number[];
}

/** Response for GetWidgetBatch. */
Expand Down Expand Up @@ -258,9 +258,9 @@ export interface IMixedResponse {

/** Request for Required. */
export interface IRequiredRequest {
query?: string;
query: string;

normal?: string;
normal: string;

widget?: IWidget;

Expand All @@ -281,7 +281,7 @@ export interface IRequiredRequest {

/** Response for Required. */
export interface IRequiredResponse {
normal?: string;
normal: string;
}

/** Request for MirrorBytes. */
Expand Down Expand Up @@ -328,7 +328,7 @@ export interface IWidget {
id?: number;

/** The name of the widget. */
name?: string;
name: string;
}

export interface IAny {
Expand Down
12 changes: 6 additions & 6 deletions 12 conformance/src/fastify/conformanceApiPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ export interface ICreateWidgetResponse {
/** Request for GetWidget. */
export interface IGetWidgetRequest {
/** The widget ID. */
id?: number;
id: number;

/** Don't get the widget if it has this ETag. */
ifNotETag?: string;
Expand Down Expand Up @@ -944,7 +944,7 @@ export interface IDeleteWidgetResponse {
/** Request for GetWidgetBatch. */
export interface IGetWidgetBatchRequest {
/** The IDs of the widgets to return. */
ids?: number[];
ids: number[];
}

/** Response for GetWidgetBatch. */
Expand Down Expand Up @@ -1075,9 +1075,9 @@ export interface IMixedResponse {

/** Request for Required. */
export interface IRequiredRequest {
query?: string;
query: string;

normal?: string;
normal: string;

widget?: IWidget;

Expand All @@ -1098,7 +1098,7 @@ export interface IRequiredRequest {

/** Response for Required. */
export interface IRequiredResponse {
normal?: string;
normal: string;
}

/** Request for MirrorBytes. */
Expand Down Expand Up @@ -1145,7 +1145,7 @@ export interface IWidget {
id?: number;

/** The name of the widget. */
name?: string;
name: string;
}

export interface IAny {
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Facility.CodeGen.JavaScript/JavaScriptGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ private static void WriteDto(CodeWriter code, ServiceDtoInfo dtoInfo, ServiceInf
{
code.WriteLineSkipOnce();
WriteJsDoc(code, fieldInfo);
code.WriteLine($"{fieldInfo.Name}?: {RenderFieldType(service.GetFieldType(fieldInfo)!)};");
code.WriteLine($"{fieldInfo.Name}{(fieldInfo.IsRequired ? "" : "?")}: {RenderFieldType(service.GetFieldType(fieldInfo)!)};");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ public void GenerateExampleApiTypeScript_DataPropertiesRequired()

var typesFile = result.Files.Single(f => f.Name == "testApiTypes.ts");
Assert.That(typesFile.Text, Does.Contain("export interface IWidget {"));
Assert.That(typesFile.Text, Does.Contain("id?: string;"));
Assert.That(typesFile.Text, Does.Contain("name?: string;"));
Assert.That(typesFile.Text, Does.Contain("id: string;"));
Assert.That(typesFile.Text, Does.Contain("name: string;"));
Assert.That(typesFile.Text, Does.Contain("price?: number;"));
Assert.That(typesFile.Text, Does.Contain("}"));
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.