Repository navigation
[Dart] Compilation errors for GITHUB.COM api #7821
Copy link
Copy link
Description
Found as part of #7774:
Using the Kiota source code from 2026-06-17 and these commands:
./it/generate-code.ps1 -descriptionUrl https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions/api.github.com/api.github.com.json -language dart -dev
.\it\exec-cmd.ps1 -descriptionUrl https://raw.githubusercontent.com/github/rest-api-description/refs/heads/main/descriptions/api.github.com/api.github.com.json -language dart
The generated client does not compile:
Analyzing lib...
error • models\code_scanning_variant_analysis.dart:40:5 • Undefined class 'CodeScanningVariantAnalysis_status'. Try
changing the name to the name of an existing class, or creating a class with the name
'CodeScanningVariantAnalysis_status'. • undefined_class
error • models\code_scanning_variant_analysis.dart:66:74 • The name 'CodeScanningVariantAnalysis_status' isn't a type,
so it can't be used as a type argument. Try correcting the name to an existing type, or defining a type named
'CodeScanningVariantAnalysis_status'. • non_type_as_type_argument
error • models\code_scanning_variant_analysis.dart:66:127 • Undefined name 'CodeScanningVariantAnalysis_status'. Try
correcting the name to one that is defined, or defining the name. • undefined_identifier
error • models\code_scanning_variant_analysis.dart:85:31 • The name 'CodeScanningVariantAnalysis_status' isn't a type,
so it can't be used as a type argument. Try correcting the name to an existing type, or defining a type named
'CodeScanningVariantAnalysis_status'. • non_type_as_type_argument
error • models\code_scanning_variant_analysis.dart:85:95 • The getter 'value' isn't defined for the type 'Object'. Try
importing the library that defines 'value', correcting the name to the name of an existing getter, or defining
a getter or field named 'value'. • undefined_getter
error • models\pull_request_webhook.dart:29:26 • Expected to find ';'. • expected_token
error • models\pull_request_webhook.dart:29:31 • Expected an identifier. • missing_identifier
error • models\pull_request_webhook.dart:29:31 • Unexpected text ';'. Try removing the text. • unexpected_token
error • models\pull_request_webhook.dart:30:31 • Expected to find ';'. • expected_token
error • models\pull_request_webhook.dart:30:36 • Expected an identifier. • missing_identifier
error • models\pull_request_webhook.dart:30:36 • Unexpected text ';'. Try removing the text. • unexpected_token
error • models\repository_ruleset.dart:21:5 • Undefined class 'RepositoryRuleset_conditions'. Try changing the name to
the name of an existing class, or creating a class with the name 'RepositoryRuleset_conditions'. •
undefined_class
error • models\repository_ruleset.dart:59:84 • The name 'RepositoryRuleset_conditions' isn't a type, so it can't be
used as a type argument. Try correcting the name to an existing type, or defining a type named
'RepositoryRuleset_conditions'. • non_type_as_type_argument
error • models\repository_ruleset.dart:59:114 • Undefined name 'RepositoryRuleset_conditions'. Try correcting the name
to one that is defined, or defining the name. • undefined_identifier
error • models\repository_ruleset.dart:79:33 • The name 'RepositoryRuleset_conditions' isn't a type, so it can't be
used as a type argument. Try correcting the name to an existing type, or defining a type named
'RepositoryRuleset_conditions'. • non_type_as_type_argument
error • repos\item\item\contents\item\with_path_get_response.dart:6:8 • Target of URI doesn't exist:
'../../../../../models/with_path.dart'. Try creating the file referenced by the URI, or try using a URI for a
file that does exist. • uri_does_not_exist
Activity
WolfgangHG commentedon Jun 22, 2026
Errortype 1
The error type "Undefined class" might be the same as #7807
Errortype 2:
This error
probably can be ignored. It happens in this line:
The type "CodeScanningVariantAnalysis_status" was not found before, see "errortype 1".
Errortype 3
This error and following errors...
...happens here:
The syntax to call the super constructor before field initialization seems to be invalid.
It works if you move the
super()call to the end of the initializers::Sample found here: https://www.darttutorial.org/dart-tutorial/dart-super/
Errortype 4
Final error is:
This sounds like a discriminator problem - see e.g. typescript error #7803 (comment)
The import seems to be unncessary, after removing it, there is no compilation error in this file.
baywet commentedon Jun 26, 2026
Maybe Ricardo Boss (@ricardoboss) will be interested in this.
ci: match main's IT suppressions for dart/typescript/java WithPath bug
chore: security-only backport of critical CVE fixes to v1.29.x (#8038)
fix: disambiguate dart file names colliding after snake casing
fix: disambiguate dart file names colliding after snake casing (micro…
Remove the TypeScript suppression for the GitHub description
fix(typescript): use the model property name in the composed type dis…
deps: Bump the nuget group with 7 updates (#123)
chore(deps): Bump the minor-and-patch group with 22 updates (#301)
deps: Bump the nuget group with 19 updates (#139)