Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
OpenAPI.Generate.ModelDependencies
Description
Functionality to split models into multiple modules according to their dependencies
Synopsis
- getModelModulesFromModelsWithDependencies :: String -> Models -> Bool -> [ModelWithDependencies] -> Q [ModuleDefinition]
- type ModuleDefinition = ([String], Doc)
- type Models = Set Text
- type ModelContentWithDependencies = (Q Doc, Models)
- type ModelWithDependencies = (Text, ModelContentWithDependencies)
Documentation
getModelModulesFromModelsWithDependencies :: String -> Models -> Bool -> [ModelWithDependencies] -> Q [ModuleDefinition] Source #
Analyzes the dependencies of the provided models and splits them into modules.
All models which would form an own module but only consist of a type alias are put in a module named by typeAliasModule
.
type ModuleDefinition = ([String], Doc) Source #
A module definition with a name as a string list with the different module levels (e. g. ["OpenAPI", "Generate"] for OpenAPI.Generate)
and the Doc
representing the module content
type ModelContentWithDependencies = (Q Doc, Models) Source #
A tuple containing the content and the dependencies of a model
type ModelWithDependencies = (Text, ModelContentWithDependencies) Source #
Represents a model with a name, content and dependencies