Collects and returns case classes that extend the given type.
Collects and returns case classes that extend the given type.
A list of tuples. Each tuple contains the path, and class def
Extracts a package path from a json-schema $ref.
Extracts a package path from a json-schema $ref. Notes:
The name of the root class. Which is used to replace #/ references
The $ref element to path-erize.
Wrap the given type in an List type
Wrap the given type in an Option type
Quasiquote doesn't support building trees of selects (i.e.
Quasiquote doesn't support building trees of selects (i.e. obj1.obj2.MyObj), so we do it here manually.
List of strings representing the paths.
e.g. obj1.obj2.myObj becomes: Select(Select(Ident(TermName("obj1")), TermName("obj2")), TermName("myObj"))
Builds on mkSelectPath, but treats last item is a Type rather than a TermName
Best attempt at producing a name from a Json blob.
Best attempt at producing a name from a Json blob. This is mostly used for enum, where the enum's can be any arbitrary Json structure. Mostly they are plain strings, in which case this is a no-op, but in the case where it's more complex then the property names from json structure are used to build a name. If the json object is a number then decimial points are stripped, and "n" is prefixed (i.e. 3.14 => n314).
Extracts argument values from a List[Tree] as is obtained from a quasiquote such as q"myFunc(..$params))".
Extracts argument values from a List[Tree] as is obtained from a quasiquote such as q"myFunc(..$params))". Supports named arguments, and default values.
A list of tuples containing each argument's name and default value. This must be the complete list of supported arguments.
A list of trees to as extracted by ..$params. If arguments are constants or option wrapped constants then their reified values are returned (i.e. Some(1)), if not then the AST chunk is returned.
A map of argument names and their extracted values (or their default value if not extracted)
Extract the select path as a List[String]
Extract the select path (ending with a TypeName) as a List[String].
Extract the select path (ending with a TypeName) as a List[String]. Types with type parameters are concatenated to form a single string. For example: a.b.MyObj[A,B[C]] becomes List(a,b,MyObjABC)
Makes type into a name, suitable for use as a variable name.
Makes type into a name, suitable for use as a variable name. Rules:
Common utils for AST munging. Also includes a few helps for constructing type names/paths from json constructs.