From 64ad47ef08f51c3f06aafbfd15992e67cbf0a266 Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Sun, 4 Aug 2024 16:18:17 -0700 Subject: [PATCH] update(conduit): updating readme --- packages/openapi/README.md | 58 ++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/packages/openapi/README.md b/packages/openapi/README.md index 8b55e73..c1ade1a 100644 --- a/packages/openapi/README.md +++ b/packages/openapi/README.md @@ -1,39 +1,37 @@ - +Reads and writes OpenAPI (Swagger) specifications. -TODO: Put a short description of the package here that helps potential users -know whether this package might be useful for them. +conduit_open_api supports both v2 and v3 of the open_api specification. -## Features - -TODO: List what your package can do. Maybe include images, gifs, or videos. - -## Getting started - -TODO: List prerequisites and provide or point to information on how to -start using the package. - -## Usage - -TODO: Include short and useful examples for package users. Add longer examples -to `/example` folder. +To use v2 import: ```dart -const like = 'sample'; +import 'package:conduit_open_api/v2.dart'; ``` -## Additional information +To use v3 import: + +```dart +import 'package:conduit_open_api/v3.dart'; +``` + +You can us v2 and v3 within a single project. + + +Example +--- + +```dart +import 'package:conduit_open_api/v3.dart'; + + +final file = File("test/specs/kubernetes.json"); +final contents = await file.readAsString(); +final doc = APIDocument.fromJSON(contents); + +final output = JSON.encode(doc.asMap()); +``` -TODO: Tell users more about the package: where to find more information, how to -contribute to the package, how to file issues, what response they can expect -from the package authors, and more.