Parser class
Parses JSON schema files and builds the template Context for code generation.
The parser is intentionally strict about required sections so generated code
is predictable and templates can rely on stable fields. It also builds
nested field graphs so templates can emit models for complex payloads and
enforces presentation configuration. The current working directory is used
as the target project root for pubspec.yaml lookup.
Constructors
- Parser()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildContext(
String featureName, Schema schema) → Future< Context> -
Builds a Context from a
featureNameand parsedschema. -
buildContextFields(
Map< String, dynamic> fields, List<NestedContextField> nestedFields) → List<ContextField> -
Converts a
{ fieldName: schemaType }map to a list of ContextFields. -
buildContextMethod(
MapEntry< String, ApiMethod> method) → ContextMethod - Converts an ApiMethod schema entry into a ContextMethod.
-
getDartType(
dynamic type) → String -
Maps a schema type (e.g.
"string","int") to its Dart type string. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String path) → Schema -
Reads and deserialises the JSON schema file at
pathinto a Schema. -
toString(
) → String -
A string representation of this object.
inherited
-
validateSchema(
Schema schema) → bool -
Validates that
schemahas the required sections and config.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited