prance.mixins

Defines Mixins for parsers.

The Mixins are here mostly for separation of concerns.

Classes

class prance.mixins.CacheSpecsMixin[source]

Bases: object

CacheSpecsMixin helps determine if self.specification changed.

It does so by caching a shallow copy on-demand.

specs_updated()[source]

Test if self.specficiation changed.

Returns

Whether the specs changed.

Return type

bool

class prance.mixins.JSONMixin[source]

Bases: CacheSpecsMixin

JSONMixin returns a JSON representation of the specification.

It uses CacheSpecsMixin for lazy evaluation.

json()[source]

Return a JSON representation of the specifications.

Returns

JSON representation.

Return type

dict

specs_updated()

Test if self.specficiation changed.

Returns

Whether the specs changed.

Return type

bool

class prance.mixins.YAMLMixin[source]

Bases: CacheSpecsMixin

YAMLMixin returns a YAML representation of the specification.

It uses CacheSpecsMixin for lazy evaluation.

specs_updated()

Test if self.specficiation changed.

Returns

Whether the specs changed.

Return type

bool

yaml()[source]

Return a YAML representation of the specifications.

Returns

YAML representation.

Return type

dict