Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- summary: |
Fix `PAYLOAD_TOO_LARGE` failures when publishing docs for large APIs with dynamic snippets. The
dynamic IRs were sent inline in the `registerApiDefinition` request once per SDK language, even
though the registry only needs the language names to issue upload URLs. The request now carries
`dynamicIRLanguages` and the IRs themselves are still uploaded to S3 separately.
type: fix
Original file line number Diff line number Diff line change
Expand Up @@ -479,16 +479,23 @@ export async function publishDocs({

const effectiveApiName = apiName ?? getOriginalName(ir.apiName);

const dynamicIRLanguages = dynamicIRsByLanguage != null ? Object.keys(dynamicIRsByLanguage) : undefined;
const registerApiDefinitionRequest = {
orgId: CjsFdrSdk.OrgId(organization),
apiId: CjsFdrSdk.ApiId(effectiveApiName),
definition: apiDefinition,
dynamicIRLanguages
};
context.logger.debug(
`registerApiDefinition request body for ${effectiveApiName}: ${Buffer.byteLength(
JSON.stringify(registerApiDefinitionRequest)
)} bytes, ${dynamicIRLanguages?.length ?? 0} dynamic IR language(s) (IR bodies are uploaded separately)`
);

let response;
try {
response = await retryWithBackoff({
fn: () =>
fdr.api.register.registerApiDefinition({
orgId: CjsFdrSdk.OrgId(organization),
apiId: CjsFdrSdk.ApiId(effectiveApiName),
definition: apiDefinition,
dynamicIRs: dynamicIRsByLanguage
}),
fn: () => fdr.api.register.registerApiDefinition(registerApiDefinitionRequest),
maxRetries: REGISTER_MAX_RETRIES,
baseDelayMs: REGISTER_BASE_DELAY_MS,
jitterFactor: REGISTER_JITTER_FACTOR,
Expand Down