You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The v2 client library (fastfuels_sdk/v2/client_library/) is generated from the API's openapi.json by fastfuels_sdk/v2/generate_client.sh (openapi-python-client, pinned 0.29.0). Several rough edges in the generated client trace back to the spec, not our wrapper — and the right fix for most of them is to clean up openapi.json in the FastFuels-API-v2 repo so the generator produces a better client with no post-generation patching.
Goal
Comb through the generated client library and generate_client.sh for warnings and bad practices, and produce a list of API-side openapi.json fixes that would yield the best possible generated client (ideally one generated with --meta defaults and zero patch steps).
Known items to fold in
Duplicate Feature schema title. The spec titles two schemas Feature (the FastFuels feature resource and geojson-pydantic's GeoJSON Feature). openapi-python-client names classes from titles and refuses the collision, so generate_client.sh patches the GeoJSON one to GeoJsonFeature before generating. Fix: re-title the model in FastFuels-API-v2 so the spec has no collision, and drop the patch step. (was the original Implement v2 API support #176 re-title checklist item)
No servers entry. The spec advertises no servers, so the generated client embeds no URL and generate_client.sh records the deployment URL into client_library/base_url.py, which api.py imports as the default. Adding a servers entry upstream would let the generated client carry the canonical URL natively and let us drop the base_url.py shim. (Connects to the stable-domain decision on Implement v2 API support #176.)
String-detail 422s. The spec types error detail as a list of validation errors, but the API sometimes returns a bare string, which crashes the stock generated parser — exceptions.py carries tolerant-parsing code to compensate. Fix the response typing (or the API's actual responses) so the generated parser is correct.
anyOf explosion. ~38% of schemas use anyOf (FastAPI/pydantic emit it for every Optional; geojson-pydantic adds geometry unions). Review whether any of it can be tightened so the generated models are cleaner.
Tasks
Run generate_client.sh and capture every generator warning; triage each to a spec fix or an accepted wart
Audit the generated models/endpoints for bad practices (naming, missing descriptions, untyped responses, the anyOf cases above)
File the resulting openapi.json fixes against FastFuels-API-v2 (cross-reference existing ones, e.g. FastFuels-API-v2#335)
Once the spec is clean, simplify generate_client.sh (drop the title patch; pick up servers) and regenerate
Part of #176.
The v2 client library (
fastfuels_sdk/v2/client_library/) is generated from the API'sopenapi.jsonbyfastfuels_sdk/v2/generate_client.sh(openapi-python-client, pinned0.29.0). Several rough edges in the generated client trace back to the spec, not our wrapper — and the right fix for most of them is to clean upopenapi.jsonin the FastFuels-API-v2 repo so the generator produces a better client with no post-generation patching.Goal
Comb through the generated client library and
generate_client.shfor warnings and bad practices, and produce a list of API-sideopenapi.jsonfixes that would yield the best possible generated client (ideally one generated with--metadefaults and zero patch steps).Known items to fold in
Featureschema title. The spec titles two schemasFeature(the FastFuels feature resource and geojson-pydantic's GeoJSONFeature). openapi-python-client names classes from titles and refuses the collision, sogenerate_client.shpatches the GeoJSON one toGeoJsonFeaturebefore generating. Fix: re-title the model in FastFuels-API-v2 so the spec has no collision, and drop the patch step. (was the original Implement v2 API support #176 re-title checklist item)serversentry. The spec advertises noservers, so the generated client embeds no URL andgenerate_client.shrecords the deployment URL intoclient_library/base_url.py, whichapi.pyimports as the default. Adding aserversentry upstream would let the generated client carry the canonical URL natively and let us drop thebase_url.pyshim. (Connects to the stable-domain decision on Implement v2 API support #176.)detailas a list of validation errors, but the API sometimes returns a bare string, which crashes the stock generated parser —exceptions.pycarries tolerant-parsing code to compensate. Fix the response typing (or the API's actual responses) so the generated parser is correct.anyOfexplosion. ~38% of schemas useanyOf(FastAPI/pydantic emit it for everyOptional; geojson-pydantic adds geometry unions). Review whether any of it can be tightened so the generated models are cleaner.Tasks
generate_client.shand capture every generator warning; triage each to a spec fix or an accepted wartanyOfcases above)openapi.jsonfixes against FastFuels-API-v2 (cross-reference existing ones, e.g. FastFuels-API-v2#335)generate_client.sh(drop the title patch; pick upservers) and regenerate