API Reference

Provides full reference to flaskdoc's API

core

Internal only functions and classes used by both swagger and flask specific customizations

class flaskdoc.core.ApiDecoratorMixin

Bases: object

Makes a model a decorator that registers itself

class flaskdoc.core.DictMixin

Bases: object

General usage mixin for handling nested dictionary conversion.

to_dict()

Converts object to dictionary

class flaskdoc.core.ExtensionMixin

Bases: flaskdoc.core.ModelMixin

add_extension(name, value)

Allows extensions to the Swagger Schema.

The field name MUST begin with x-, for example, x-internal-id. The value can be null, a primitive, an array or an object. :param name: custom extension name, must begin with x- :type name: str :param value: value, can be None, any object or list :type value: Any

Returns

for chaining

Return type

ModelMixin

Raises

ValueError – if key name is invalid

validate(_, ext)

Validates the name of all provided extensions

static validate_extension_name(value)

Validates a custom extension name :param value: custom extension name :type value: str

Raises

ValueError – if key name is invalid

class flaskdoc.core.ModelMixin

Bases: flaskdoc.core.DictMixin

Swagger Model mixin that provides common methods like to dict and to json

flaskdoc.core.camel_case(snake_case)

Converts snake case strings to camel case

Parameters

snake_case (str) – raw snake case string, eg sample_text

Returns

camel cased string

Return type

str