Skip to main content

swagger_parser_core 1.0.1 copy "swagger_parser_core: ^1.0.1" to clipboard
swagger_parser_core: ^1.0.1 copied to clipboard

Typed Swagger and OpenAPI models with JSON/YAML parsing, validation, and reference resolution for swagger_parser.

swagger_parser_core #

Pub version Pub likes Dart style GitHub stars Last commit Tests

OpenAPI parsing, validation, reference resolution, and normalization for swagger_parser. Also works as a standalone library.

Supports Swagger 2.0 and OpenAPI 3.0.x, 3.1.x, and 3.2.x in JSON or YAML. Runs on VM and web. Does not generate Dart code.

Install #

dependencies:
  swagger_parser_core: ^1.0.1

Run dart pub get.

Parse #

import 'package:swagger_parser_core/swagger_parser_core.dart';

final document = const OpenApiParser().parse(SchemaSource(text));
final report = const OpenApiValidator().validate(document);
final json = document.toJson();

text contains JSON or YAML. Use SchemaSource.json or SchemaSource.yaml to require one format. Parsing returns an immutable, version-specific document. Errors include the source URI, JSON Pointer, and available coordinates.

See the guide for input bytes, parser settings, external references, and normalization. See CONTRIBUTING.md for checks.

0
likes
160
points
0
downloads

Documentation

API reference

Publisher

verified publishercarapacik.dev

Weekly Downloads

Typed Swagger and OpenAPI models with JSON/YAML parsing, validation, and reference resolution for swagger_parser.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

source_span, yaml

More

Packages that depend on swagger_parser_core