Skip to content

Commit

Permalink
Remove non-null assertion; snapshot updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
eyw520 committed Nov 26, 2024
1 parent 0ff940a commit 5f8075c
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ function maybeIntegerValidation(v2: PrimitiveTypeV2 | undefined): IntegerValidat

function getStringExampleOfLength(length: number): string {
if (length <= Examples.SAMPLE_STRINGS.length) {
return Examples.SAMPLE_STRINGS[length - 1]!;
const sampleString = Examples.SAMPLE_STRINGS[length - 1];
if (sampleString) {
return sampleString;
} else {
throw new Error(`Unexpected undefined value in SAMPLE_STRINGS at index ${length - 1}`);
}
}
return (
Examples.SAMPLE_STRINGS[Examples.SAMPLE_STRINGS.length - 1] +
Expand Down Expand Up @@ -170,7 +175,6 @@ function generatePrimitiveDoubleExample({
return { type: "success", example: ExamplePrimitive.double(minimum), jsonExample: minimum };
}
}
const jsonExample = fieldName ?? Examples.DOUBLE;
return { type: "success", example: ExamplePrimitive.double(Examples.DOUBLE), jsonExample: Examples.DOUBLE };
}

Expand All @@ -190,6 +194,5 @@ function generatePrimitiveIntegerExample({
return { type: "success", example: ExamplePrimitive.integer(minimum), jsonExample: minimum };
}
}
const jsonExample = fieldName ?? Examples.DOUBLE;
return { type: "success", example: ExamplePrimitive.integer(Examples.INT), jsonExample: Examples.INT };
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions seed/go-sdk/validation/snippet.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions seed/postman/validation/collection.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions seed/ruby-sdk/validation/lib/fern_validation.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions seed/ruby-sdk/validation/snippet.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion seed/ts-sdk/validation/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion seed/ts-sdk/validation/reference.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions seed/ts-sdk/validation/resolved-snippet-templates.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions seed/ts-sdk/validation/snippet.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions seed/ts-sdk/validation/src/Client.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5f8075c

Please sign in to comment.