openapi_spec 0.7.24 openapi_spec: ^0.7.24 copied to clipboard
OpenAPI Specification generator using native Dart code, as well as an all-in-one parser of existing specifications.
import 'package:openapi_spec/openapi_spec.dart';
void main() async {
// ==========================================
// Define the spec
// ==========================================
final spec = OpenApi(
info: Info(
title: 'My API',
version: '1.0.0',
),
);
// ==========================================
// Export to Swagger UI
// ==========================================
await spec.toSwaggerUI(
destination: './build/swagger_ui',
replace: true,
);
}