Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
OpenAPI.Generate.Model
Description
Defines functionality for the generation of models from OpenAPI schemas
Synopsis
- getSchemaType :: Settings -> SchemaObject -> Name
- resolveSchemaReferenceWithoutWarning :: Schema -> Generator (Maybe SchemaObject)
- getConstraintDescriptionsOfSchema :: Maybe SchemaObject -> [Text]
- defineModelForSchemaNamed :: Text -> Schema -> Generator TypeWithDeclaration
- defineModelForSchema :: Text -> Schema -> Generator ModelWithDependencies
- type TypeWithDeclaration = (Q Type, ModelContentWithDependencies)
Documentation
getSchemaType :: Settings -> SchemaObject -> Name Source #
Extracts the Name
of a SchemaObject
which should be used for primitive types
resolveSchemaReferenceWithoutWarning :: Schema -> Generator (Maybe SchemaObject) Source #
Transforms a Schema
(either a reference or a concrete object) to
If a reference is found it is resolved. If it is not found, no log message is generated.Maybe
SchemaObject
getConstraintDescriptionsOfSchema :: Maybe SchemaObject -> [Text] Source #
Extracts the constraints of a SchemaObject
as human readable text
defineModelForSchemaNamed :: Text -> Schema -> Generator TypeWithDeclaration Source #
Defines all the models for a schema and returns the declarations with the type of the root model
defineModelForSchema :: Text -> Schema -> Generator ModelWithDependencies Source #
Defines all the models for a schema
type TypeWithDeclaration = (Q Type, ModelContentWithDependencies) Source #
The type of a model and the declarations needed for defining it