-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1024 from nextcloud/fix/dynamite/header_type_reso…
…lver Fix/dynamite/header type resolver
- Loading branch information
Showing
10 changed files
with
795 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/dynamite/dynamite/lib/src/builder/generate_schemas.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:code_builder/code_builder.dart'; | ||
import 'package:dynamite/src/builder/resolve_type.dart'; | ||
import 'package:dynamite/src/builder/state.dart'; | ||
import 'package:dynamite/src/helpers/dart_helpers.dart'; | ||
import 'package:dynamite/src/models/openapi.dart' as openapi; | ||
|
||
Iterable<Spec> generateSchemas( | ||
final openapi.OpenAPI spec, | ||
final State state, | ||
) sync* { | ||
if (spec.components?.schemas != null) { | ||
for (final schema in spec.components!.schemas!.entries) { | ||
final identifier = toDartName(schema.key, uppercaseFirstCharacter: true); | ||
|
||
resolveType( | ||
spec, | ||
state, | ||
identifier, | ||
schema.value, | ||
); | ||
} | ||
} | ||
|
||
yield* state.output; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.