Generator Config#

The configuration offers more advance options to further tail the output to your needs, like naming conventions and substitutions.

Warning

Since v21.12 the aliases were replaced by the substitutions config which is a more flexible search and replace process with support for regular expressions.

During initialization aliases will be migrated to substitutions and the config will be automatically updated, but you should also verify you still get the desired output.

Initializing configuration file .xsdata.xml
<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns="http://pypi.org/project/xsdata" version="24.1">
  <Output maxLineLength="79" subscriptableTypes="false" unionType="false">
    <Package>generated</Package>
    <Format repr="true" eq="true" order="false" unsafeHash="false" frozen="false" slots="false" kwOnly="false">dataclasses</Format>
    <Structure>filenames</Structure>
    <DocstringStyle>reStructuredText</DocstringStyle>
    <FilterStrategy>allGlobals</FilterStrategy>
    <RelativeImports>false</RelativeImports>
    <CompoundFields defaultName="choice" useSubstitutionGroups="false" forceDefaultName="false" maxNameParts="3">false</CompoundFields>
    <PostponedAnnotations>false</PostponedAnnotations>
    <UnnestClasses>false</UnnestClasses>
    <IgnorePatterns>false</IgnorePatterns>
    <IncludeHeader>false</IncludeHeader>
  </Output>
  <Conventions>
    <ClassName case="pascalCase" safePrefix="type"/>
    <FieldName case="snakeCase" safePrefix="value"/>
    <ConstantName case="screamingSnakeCase" safePrefix="value"/>
    <ModuleName case="snakeCase" safePrefix="mod"/>
    <PackageName case="snakeCase" safePrefix="pkg"/>
  </Conventions>
  <Substitutions>
    <Substitution type="package" search="http://www.w3.org/2001/XMLSchema" replace="xs"/>
    <Substitution type="package" search="http://www.w3.org/XML/1998/namespace" replace="xml"/>
    <Substitution type="package" search="http://www.w3.org/2001/XMLSchema-instance" replace="xsi"/>
    <Substitution type="package" search="http://www.w3.org/1998/Math/MathML" replace="mathml3"/>
    <Substitution type="package" search="http://www.w3.org/1999/xlink" replace="xlink"/>
    <Substitution type="package" search="http://www.w3.org/1999/xhtml" replace="xhtml"/>
    <Substitution type="package" search="http://schemas.xmlsoap.org/wsdl/soap/" replace="soap"/>
    <Substitution type="package" search="http://schemas.xmlsoap.org/wsdl/soap12/" replace="soap12"/>
    <Substitution type="package" search="http://schemas.xmlsoap.org/soap/envelope/" replace="soapenv"/>
    <Substitution type="class" search="(.*)Class$" replace="\1Type"/>
  </Substitutions>
  <Extensions/>
</Config>

GeneratorConfig

Generator configuration model representation.

GeneratorOutput

Generator output model representation.

OutputFormat

Output format model representation.

GeneratorConventions

Generator naming conventions model representation.

GeneratorSubstitutions

Generator substitutions model representation.

GeneratorExtensions

Generator extensions model representation.

StructureStyle

Output structure style enumeration.

DocstringStyle

Docstring style enumeration.

ClassFilterStrategy

Class filter strategy enumeration.

CompoundFields

Compound fields model representation.

ObjectType

Object type enumeration.

ExtensionType

Extension type enumeration.

GeneratorSubstitution

Generator substitution model representation.

GeneratorExtension

Generator extension model representation.

NameConvention

Name convention model representation.

NameCase

Naming case convention enumeration.