space_gen icon indicating copy to clipboard operation
space_gen copied to clipboard

fix: add support for multipart schemas

Open bryanoltman opened this issue 5 months ago • 0 comments

To reproduce, run:

dart run space_gen -i https://raw.githubusercontent.com/openfoodfacts/openfoodfacts-server/dad1ccf2cec963f1e9b0d0135b43274b26295d61/docs/api/ref/api.yaml -o openfoodfacts_api

See the error:

[WARN] Unknown string format: password in #/paths//cgi/session.pl/post/requestBody/content/application/x-www-form-urlencoded/schema/properties/password
Unhandled exception:
FormatException: $ref not expected in #/components/schemas/Product-Base
#0      _error (package:space_gen/src/parser.dart:129:3)
#1      _refNotExpected (package:space_gen/src/parser.dart:17:5)
#2      parseSchema (package:space_gen/src/parser.dart:675:3)
#3      _parseComponent (package:space_gen/src/parser.dart:922:26)
#4      parseComponents (package:space_gen/src/parser.dart:938:19)
#5      parseOpenApi (package:space_gen/src/parser.dart:1043:22)
#6      loadAndRenderSpec (package:space_gen/src/render.dart:66:16)
<asynchronous suspension>
#7      run (file:///Users/bryanoltman/Documents/space_gen/bin/space_gen.dart:39:3)
<asynchronous suspension>

This is because the schema is multipart, and space_gen does not support mutlipart schemas

bryanoltman avatar Jul 07 '25 20:07 bryanoltman