fix: OpenAPI guardian sweep 2026-08-11 (customers, billing entities, organizations) - #563
Merged
Conversation
Contributor
|
Note: I've updated BE to not ignore "alavara" for serialising integration_customer (PR) |
Contributor
Author
|
Guardian follow-up (sweep of 2026-08-17): thanks for the approval and for the heads-up on the backend change — no action needed on this branch. This PR is still open and unmerged, so today's sweep (#566) deliberately covered only the parts of slice 2 that this branch does not touch. Please merge this one first — the only file both touch is |
added 4 commits
August 27, 2026 17:11
annvelents
force-pushed
the
openapi-guardian/2026-08-11
branch
from
August 27, 2026 15:11
d228faf to
bc7da0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenAPI Guardian sweep — 2026-08-11 (slice 2: customers, billing_entities, organizations)
Automated twice-weekly spec sweep vs lago-api and the SDK clients.
A human must review and merge — this agent never merges.
npm run buildandnpm run testpass on this branch.Fixed in this PR
Field-level evidence
src/schemas/_index.yaml+ file rename:CustomerIntegratrionErrorObject→CustomerIntegrationErrorObject(2 webhook refs updated) — typo in component and file name.src/schemas/_index.yaml: index keyCustomerPaymentProvidernErrorObject→CustomerPaymentProviderErrorObject— typo'd key was the source of theoas3-unused-componentlint warning.src/resources/billing_entity.yamlpath paramcode: was "The ID of the billing entity" withformat: uuid— it is the entity's code (plain string). Evidence:routes.rbresources :billing_entities, param: :code; controllerBillingEntity.find_by(code: params[:code]).src/schemas/IntegrationCustomer.yamltypedescription: "Accepted values: netsuite, anrok" was stale vs its own enum.src/schemas/CustomerCreateInput.yamlmetadata items: droppeddisplay_in_invoicefromrequired—customer_metadata.display_in_invoiceisDEFAULT false NOT NULL(structure.sql) and the controller permits its absence.src/resources/billing_entity.yamlPUT requestBody: addedrequired: true—params.require(:billing_entity)400s without a body.src/resources/customers.yaml: addedexternal_idquery filter — permitted inCustomersController#indexparams.permit(:external_id, ...)but undocumented.src/resources/organizations.yaml: addedGET /organizations—routes.rbget "/organizations", to: "organizations#show"exists; the spec only had PUT.src/schemas/CustomerCreateInput.yaml+CustomerBaseObject.yaml: addedexternal_salesforce_id— permitted increate_paramsand always emitted byV1::CustomerSerializer(nullable varchar in structure.sql).src/schemas/CustomerCreateInput.yamlintegration_customers: addedtargeted_object(permitted) and extendedintegration_typeenum withavalara,hubspot,salesforce— all map to integration customer classes inIntegrationCustomers::BaseCustomer.customer_type.src/schemas/CustomerBillingConfiguration.yamlpayment_providerenum: addedcashfree,flutterwave,moneyhash—Customer::PAYMENT_PROVIDERSvalidates 6 values, spec listed 3.src/schemas/BillingEntityObject.yaml+BillingEntityCreateInput.yaml+BillingEntityUpdateInput.yaml: addedphoneandeinvoicing— both permitted by the controller and always serialized byV1::BillingEntitySerializer.src/schemas/BillingEntityUpdateInput.yaml: wrapped payload under a requiredbilling_entityroot key —update_paramsisparams.require(:billing_entity).permit(...); a request built from the old spec shape fails. The sibling create input was already wrapped.src/resources/billing_entities.yamlPOST +billing_entity.yamlPUT responses: wrapped in{"billing_entity": ...}— the controller renders withroot_name: "billing_entity"; GET was already documented wrapped.country(all 3 schemas): switched toCountryOrNull— column is nullable; the previousnullable: truenext to a$refis a no-op in OpenAPI 3.1.email_settingsinput enums: addedpayment_receipt.created— present in both models'EMAIL_SETTINGS.src/schemas/OrganizationObject.yaml: addedslugand definedemail_settings(it was listed inrequiredbut had no property definition — a published inconsistency); both always emitted byV1::OrganizationSerializer.src/schemas/OrganizationUpdateInput.yaml: addedslug— permitted ininput_params.[BREAKING-DOC] flags
CustomerIntegrationErrorObject,CustomerPaymentProviderErrorObjectindex key): type names in generated clients (JS) change on next regeneration.BillingEntityUpdateInputwrapper and the POST/PUT billing entity response wrappers: generated request/response types change shape. The old shapes did not work against the API (unwrapped update payloads are rejected; responses were always wrapped), so this aligns docs with reality rather than changing behavior.SDK drift (spec is right — needs an sdk-clients-update run)
account_type,external_salesforce_id,integration_customers[].targeted_objectmissing from create/update paramsexternal_id,account_type[],billing_entity_codes[];CustomerInputmissinglogo_urlpayment_providerenum has 3 of 6 values; integration type enum hasnetsuite/anrokonly; single list filter (external_customer_id, which is not an API filter name)logo_urlbut the API permitslogo— logo upload silently no-opseinvoicingmissing everywhere; go also missesphone; input email_settings enums lackpayment_receipt.createdwhere typedwebhook_urlson update, which the API does not permit (ignored)OrganizationInputincludesname, which the API does not permit (ignored); result lackslago_idslugmissing from update params and response modelsNeeds human confirmation (not changed)
V1::IntegrationCustomerSerializer#typehas noavalarabranch: an Avalara integration customer serializes as"type": null, violating the response schema (typerequired, non-null enum). Looks like a lago-api bug rather than a spec fix; the response enum was left withoutavalara.GET /organizations/grpc_tokenexists in routes but is undocumented — assumed internal, left out.IntegrationCustomers::BaseCustomer.customer_typealso acceptsokta— assumed SSO-internal, not added to the public enum.Deferred to next run