SwaggerUI class Null safety
This class starts all the default attributes to start swagger-ui.
In addition to receiving the Spec (YAML/JSON)
it is also possible to configure the title and enable "deepLink".
fileSchemaPath: Schema path (YAML/JSON).
title: Defines the title that is visible in the browser tab.
docExpansion: (Default DocExpansion.list), Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing).
deepLink: (Default true) enables the use of deep-links to reference each node in the url (ex: /swagger/#/post).
syntaxHighlightTheme: (Default SyntaxHighlightTheme.agate) Highlight.js syntax coloring theme to use. (Only these 6 styles are available).
persistAuthorization: (Default false) If set to true, it persists authorization data and it would not be lost on browser close/refresh.
Example:
final swaggerHandler = SwaggerUI(
'swagger/swagger.yaml',
title: 'Ship API',
deepLink: true,
);
var server = await io.serve(swaggerHandler, '0.0.0.0', 4000);
Constructors
- SwaggerUI(String fileSchemaPath, {String title = 'Shelf Swagger', DocExpansion docExpansion = DocExpansion.list, SyntaxHighlightTheme syntaxHighlightTheme = SyntaxHighlightTheme.agate, bool deepLink = false, bool persistAuthorization = false})
Properties
- deepLink → bool
-
(Default false) enables the use of deep-links to reference each node in the url (ex: /swagger/#/post).
final
- docExpansion → DocExpansion
-
Controls the default expansion setting for the operations and tags.
final
- fileSchemaPath → String
-
Schema path (YAML/JSON).
final
- hashCode → int
-
The hash code for this object.
read-only, inherited
- persistAuthorization → bool
-
If set to true, it persists authorization data and it would not be lost on browser close/refresh
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- syntaxHighlightTheme → SyntaxHighlightTheme
-
Highlight.js syntax coloring theme to use. (Only these 6 styles are available).
final
- title → String
-
Defines the title that is visible in the browser tab.
final
Methods
-
call(
Request request) → FutureOr< Response> - Shelf Handler
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited