Specs

The specs describe all types the server exchanges with the outside world. They are generated from the source code by generator and used at runtime by runtime.

What is collected

The generator parses the Python modules of gws and of the plugins in the manifest, without importing them. It collects:

Where specs are used

The server generates the specs each time it configures, and the gws CLI each time it runs, so code changes need no build step. The specs are used to:

make.sh spec writes the specs to app/__build for the development tools:

FileUsed for
specs.jsonclient build
gws.generated.tsclient types, see Actions and requests
configref.en.md, configref.de.mdconfiguration reference, see Configuration reference

Supported types

Fields of Config, Props, Request and Response classes can use:

Union types are not supported.

Special types

Some types are strings in the configuration and are converted when the configuration is read:

TypeConfiguration valueRuntime value
AclStr"allow admin, deny all"Acl
CrsName"EPSG:3857", 3857Crs
Duration"1h30m", 90seconds as int
DateStr, DateTimeStrISO date or date-timedatetime
FilePath, DirPathpath, relative to the configuration fileabsolute path, must exist
UomValueStr"10px", "5mm"UomValue
UomPointStr, UomSizeStr"10px 20px"UomPoint, UomSize
UomExtentStrfour values and a unitUomExtent
Regexregular expressionstr, checked for syntax
Urlhttp or https URLstr

self.cfg() returns the converted values. The conversions are defined in reader.

Docstrings

Docstrings of Config classes and their fields end up in the configuration reference. Enum members are documented the same way as fields:

class DisplayMode(gws.Enum):
    """Layer display mode."""

    box = 'box'
    """Display a layer as one big image."""
    tile = 'tile'
    """Display a layer in a tile grid."""

A docstring that ends with (added in 8.1), (changed in 8.2) or (deprecated in 8.3) is shown with a version label.