darto_openapi 1.1.0
darto_openapi: ^1.1.0 copied to clipboard
OpenAPI 3.1 spec generation and Scalar API docs for the Darto web framework — describe a route once to validate requests and document them.
1.1.0 #
Schema.objectproperties are now required by default. Mark a field optional withrequired: falseon the field itself (Schema.string(..., required: false)), instead of maintaining a separate name list.- The object-level
required:list still works and, when provided, overrides the per-field flags — fully backward compatible. - Nest an optional object with
Schema.object(..., isRequired: false).
1.0.0 #
- Initial release.
OpenApi(app, info:, servers:)registry —get/post/put/patch/deleteregister a route on the app and record it for the spec.Schemabuilder (object/string/integer/number/boolean/array/raw) that generates OpenAPI 3.1 Schema Objects and validates values.- Request validation covers
json(body),params(path),queryandheaders. Path/query/header values are coerced from strings to the declared scalar type before validation; query/header are optional when absent. On failure responds400withissuesgrouped by target; on success populatesc.req.valid('<target>'). SecurityScheme(bearer/basic/apiKey/http) + per-routesecurity: ['<name>'], emitted undercomponents.securitySchemes.Info,Server,Req,Restypes.docs()middleware serves/openapi.jsonand a Scalar API reference UI.generateDartClient(spec, {className, baseUrl})— generates an end-to-end typed Dart client from the OpenAPI document: model classes (withfromJson/toJson) for request/response bodies and typed methods per operation. Dependency-free (dart:io+dart:convert).