Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0306801
This seems to work up to problems with the ordering of fields
Quafadas Apr 14, 2023
879c82c
Now with tests
Quafadas Apr 14, 2023
09b1620
That should test upickle
Quafadas Apr 14, 2023
7cc892f
See if this runs the upickle suite
Quafadas Apr 14, 2023
3027c8d
Remove extraneous declarations
Quafadas Apr 14, 2023
ecb282f
Greatly improve enum encoding
Quafadas Apr 21, 2023
5c23948
Fix linting error
Quafadas Apr 21, 2023
c8afd56
Oops, remove non existing language
Quafadas Apr 21, 2023
017c758
Cant have wildcard enums
Quafadas Apr 21, 2023
fc97a63
Merge branch 'master' into improved-scala3-enums
dvdsgl May 16, 2023
ff38452
Merge branch 'quicktype:master' into improved-scala3-enums
Quafadas May 17, 2023
77eeee2
Try to fix some of the linting problems
Quafadas May 17, 2023
cfca165
Undo bad linting suggestions
Quafadas May 17, 2023
721b70a
Merge branch 'master' into improved-scala3-enums
dvdsgl Jun 3, 2023
c5e70b8
Merge branch 'master' into improved-scala3-enums
dvdsgl Jun 4, 2023
a332dbb
Merge branch 'master' into improved-scala3-enums
dvdsgl Feb 14, 2024
54f3e9b
Merge branch 'master' into improved-scala3-enums
dvdsgl Feb 14, 2024
945899c
C#: Adds version 8 and expands nullability to reference types (#1632)
Mar 26, 2025
7fb4358
C#: Adds JsonRequired attribute to System.Text.Json classes for requi…
Jun 16, 2025
cbecc7f
Support for python 3.9
matthew-c-lee Jun 26, 2025
2ad08bf
Fix bug
matthew-c-lee Jun 26, 2025
6b00eca
Update Python version in tests to 3.9
matthew-c-lee Jun 26, 2025
9824c3e
Fixed bug
matthew-c-lee Jun 26, 2025
aba2303
Use python 3.9 in tests
matthew-c-lee Jun 26, 2025
bf6b307
feat: add --prefer-unknown option for TypeScript and Flow
k-vasily Mar 11, 2026
89ca47c
Merge remote-tracking branch 'origin/master' into HEAD
schani Jul 9, 2026
d5c5f5f
Merge master and resolve conflicts
schani Jul 9, 2026
2467000
Merge master and resolve conflicts
schani Jul 9, 2026
b972d13
Merge master and resolve conflicts
schani Jul 9, 2026
5cd5112
C#: fix up version-8 nullable-reference-types support
schani Jul 19, 2026
86c2a8d
Merge remote-tracking branch 'origin/master' into csharp8-fixes-2694
schani Jul 19, 2026
325cb37
Fix Python 3.10 type-hint syntax support
schani Jul 19, 2026
c349575
Merge remote-tracking branch 'origin/master' into python310-fixes-2795
schani Jul 19, 2026
2a89158
Merge origin/master into #2862 (prefer-unknown)
schani Jul 19, 2026
4c99995
Make prefer-unknown the default for TypeScript and Flow
schani Jul 19, 2026
b3cb535
C#: also suppress CS8765 for Newtonsoft at csharp-version 8
schani Jul 19, 2026
96f3acc
Give = None defaults to Any/None dataclass fields
schani Jul 19, 2026
30bf5a2
Merge origin/master into PR #2246 head
schani Jul 19, 2026
6022de7
scala3: real enum codecs, safer union decoding, top-level primitives
schani Jul 20, 2026
ba661fe
scala3: fix the upickle renderer's unions, enums, and null members
schani Jul 20, 2026
1f6a642
Register the scala3-upickle fixture and overhaul the scala3 skip lists
schani Jul 20, 2026
86dc02e
build(deps-dev): bump @types/unicode-properties from 1.3.0 to 1.3.2
dependabot[bot] Jul 20, 2026
c5775a3
build(deps): bump @types/urijs from 1.19.25 to 1.19.26
dependabot[bot] Jul 20, 2026
a80b105
Merge pull request #2795 from matthew-c-lee/python3.9
schani Jul 20, 2026
38911cc
Merge pull request #2694 from Flern/master
schani Jul 20, 2026
d5096b5
Merge pull request #2862 from k-vasily/feat/prefer-unknown
schani Jul 20, 2026
6325f66
Merge pull request #2246 from Quafadas/improved-scala3-enums
schani Jul 20, 2026
0e52ea8
Merge pull request #2955 from glideapps/dependabot/npm_and_yarn/types…
schani Jul 20, 2026
9741353
Merge pull request #2956 from glideapps/dependabot/npm_and_yarn/types…
schani Jul 20, 2026
cc3c3b0
build(deps-dev): bump ajv from 5.5.2 to 8.20.0
dependabot[bot] Jul 20, 2026
608516a
test: adapt schema-json fixture to Ajv 8 API
schani Jul 20, 2026
5f0e4a9
Merge pull request #2957 from glideapps/dependabot/npm_and_yarn/ajv-8…
schani Jul 20, 2026
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
9 changes: 5 additions & 4 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- ruby
- php,schema-php
- scala3,schema-scala3
- scala3-upickle,schema-scala3-upickle
- elixir,schema-elixir,graphql-elixir
- comment-injection-treesitter,comment-injection-typescript,comment-injection-typescript-zod,comment-injection-typescript-effect-schema

Expand Down Expand Up @@ -124,7 +125,7 @@ jobs:
if: ${{ contains(matrix.fixture, 'csharp') }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6
dotnet-version: 8

- name: Install Rust
if: ${{ contains(matrix.fixture, 'rust') }}
Expand All @@ -145,16 +146,16 @@ jobs:
if ! command -v stack > /dev/null 2>&1; then
curl -sL "https://get.haskellstack.org/" | sh
fi
- name: Install Python 3.7
- name: Install Python 3.12
if: ${{ contains(matrix.fixture, 'python') }}
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: "3.12"

- name: Install Python Dependencies
if: ${{ contains(matrix.fixture, 'python') }}
run: |
pip3.7 install mypy python-dateutil types-python-dateutil
pip3.12 install mypy python-dateutil types-python-dateutil
- name: Install flow
if: ${{ contains(matrix.fixture, 'flow') }}
run: |
Expand Down
135 changes: 46 additions & 89 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
"@types/semver": "^7.5.0",
"@types/shelljs": "^0.10.0",
"@types/stream-json": "^1.7.3",
"@types/urijs": "^1.19.25",
"@types/urijs": "^1.19.26",
"@types/wordwrap": "^1.0.3",
"ajv": "^5.5.2",
"ajv": "^8.20.0",
"ajv-formats": "^3.0.1",
"deep-equal": "^2.2.3",
"esbuild": "^0.28.1",
"promise-timeout": "^1.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/quicktype-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@glideapps/ts-necessities": "2.2.3",
"@types/readable-stream": "4.0.10",
"@types/urijs": "^1.19.25",
"@types/urijs": "^1.19.26",
"browser-or-node": "^3.0.0",
"collection-utils": "^1.0.1",
"is-url": "^1.2.4",
Expand All @@ -49,7 +49,7 @@
"@types/is-url": "^1.2.32",
"@types/node": "~20.19.0",
"@types/pluralize": "0.0.30",
"@types/unicode-properties": "^1.3.0",
"@types/unicode-properties": "^1.3.2",
"@types/wordwrap": "^1.0.3",
"typescript": "~7.0.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class CSharpRenderer extends ConvenienceRenderer {
): Sourcelike {
t = followTargetType(t);
const csType = this.csType(t, follow, withIssues);
if (isValueType(t)) {
if (isValueType(t) || this._csOptions.version >= 8) {
return [csType, "?"];
} else {
return csType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ export class NewtonsoftCSharpRenderer extends CSharpRenderer {
return this._options.baseclass;
}

protected emitDefaultFollowingComments(): void {
if (!this._needHelpers || this._options.version < 8) return;

this.emitLine("#pragma warning restore CS8618");
this.emitLine("#pragma warning restore CS8601");
this.emitLine("#pragma warning restore CS8603");
this.emitLine("#pragma warning restore CS8765");
}

protected emitDefaultLeadingComments(): void {
if (!this._needHelpers) return;

Expand Down Expand Up @@ -225,6 +234,14 @@ export class NewtonsoftCSharpRenderer extends CSharpRenderer {
";",
);
});

if (this._options.version >= 8) {
this.emitLine("#nullable enable");
this.emitLine("#pragma warning disable CS8618");
this.emitLine("#pragma warning disable CS8601");
this.emitLine("#pragma warning disable CS8603");
this.emitLine("#pragma warning disable CS8765");
}
}

private converterForType(t: Type): Name | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ export class SystemTextJsonCSharpRenderer extends CSharpRenderer {
const isNullable = followTargetType(property.type).isNullable;
const isOptional = property.isOptional;

// [JsonRequired] makes deserialization fail if the property is
// missing from the JSON. It requires System.Text.Json 7.0 or
// later (.NET 7+).
if (this._options.checkRequired && !isOptional) {
attributes.push(["[JsonRequired]"]);
}

if (isOptional && !isNullable) {
attributes.push([
"[",
Expand Down
1 change: 1 addition & 0 deletions packages/quicktype-core/src/language/CSharp/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const cSharpOptions = {
{
"5": 5,
"6": 6,
"8": 8,
} as const,
"6",
"secondary",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ export class JavaScriptRenderer extends ConvenienceRenderer {
};
}

/** The expression a deserializer returns when runtime typechecks
* are disabled. Subclasses can wrap it in a cast to the target
* type if `parsedJson`'s type isn't assignable to it. */
protected uncheckedParsedJson(
_t: Type,
parsedJson: Sourcelike,
): Sourcelike {
return parsedJson;
}

protected emitConvertModuleBody(): void {
const converter = (t: Type, name: Name): void => {
const typeMap = this.typeMapTypeFor(t);
Expand All @@ -251,7 +261,11 @@ export class JavaScriptRenderer extends ConvenienceRenderer {
? "JSON.parse(json)"
: "json";
if (!this._jsOptions.runtimeTypecheck) {
this.emitLine("return ", parsedJson, ";");
this.emitLine(
"return ",
this.uncheckedParsedJson(t, parsedJson),
";",
);
} else {
this.emitLine(
"return cast(",
Expand Down
Loading
Loading