Skip to content

feat: added document filtering during export depending on shareability status#73

Open
vOrigins wants to merge 5 commits intodevelopfrom
feature/document-shareability
Open

feat: added document filtering during export depending on shareability status#73
vOrigins wants to merge 5 commits intodevelopfrom
feature/document-shareability

Conversation

@vOrigins
Copy link
Copy Markdown
Contributor

No description provided.

@vOrigins vOrigins requested a review from b41ex as a code owner March 27, 2026 10:21
@github-actions github-actions bot added bug Something isn't working enhancement New feature or request refactor labels Mar 27, 2026
@vOrigins vOrigins requested a review from b41ex March 27, 2026 11:14
@vOrigins vOrigins marked this pull request as draft March 28, 2026 09:43
@vOrigins vOrigins marked this pull request as ready for review March 28, 2026 11:43

buildResult.exportFileName = createSingleFileExportName(packageId, version, getDocumentTitle(buildResult.exportDocuments[0].filename), format)
const singleExportDocument = buildResult.exportDocuments[0]
const singleExportDocumentExtension = isSingleNonRestDocument
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add tests to this logic?
I.e. that the output is either zip archive or single file depending on number of documents to be exported (and format?).


const documentsToExport = filterDocumentsByShareabilityStatus(documents, config)

const isSingleNonRestDocument = documentsToExport.length === 1 && !isRestDocument(documentsToExport[0])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this flag used once, move it to line 63

const { createExportDocument } = apiBuilders.find(({ types }) => types.includes(document.type)) || unknownApiBuilder
const file = await rawDocumentResolver(versionWithRevision, packageId, document.slug)
return await createExportDocument?.(file.name, await file.text(), format, packageName, version, templateResolver, allowedOasExtensions) ?? createUnknownExportDocument(file.name, file)
}))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callback on lines 97-101 and 130-134 seems the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FE][CR] Meta-marker on Spec level for "Sharable/Non-sharable"

4 participants