toMap method

Map<String, dynamic> toMap()

Converts the OpenAPI specification into a map for serialization.

Returns a map representation following OpenAPI 3.0.1 format. Includes version, info, external docs, and servers in OpenAPI structure.

Implementation

Map<String, dynamic> toMap() => {
      'openapi': '3.0.1',
      'info': info.toMap(),
      'externalDocs': externalDocs?.toMap(),
      'servers': servers?.map((e) => {'url': e}).toList(),
    };