Skip to content

Conversation

@AyushShri
Copy link
Collaborator

Added title and description to type schema for 2-way-sync

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

integration test code coverage

Lines Statements Branches Functions
Coverage: 19%
19.27% (2043/10598) 13.46% (996/7397) 19.86% (235/1183)
Coverage Breakdown • (19%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files19.2713.4619.8619.56 
report-only-changed-files is enabled. No files were changed in this commit :)

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

unit test code coverage

Lines Statements Branches Functions
Coverage: 89%
89.18% (5791/6493) 80.85% (3788/4685) 93.67% (859/917)
Coverage Breakdown • (89%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files89.1880.8593.6789.3 
report-only-changed-files is enabled. No files were changed in this commit :)

utils.addToJsonPath(currentPath, [compositeKeyword, index]));
}) };
return {
title: schema.title,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should only add title and description fields if they have a valid value.

Let's do this for all other places where we're adding title and description

Copy link
Collaborator Author

@AyushShri AyushShri Sep 24, 2025

Choose a reason for hiding this comment

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

you mean undefined title and description ?
The key is already dropped when we do stringification of the type data right ? and thats why we never get undefined in types

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it doesn't affect the type information. But you're adding unnecessary fields into the schema object that is passed and used everywhere in the module. The undefined fields are not just added for the type information.
Which I'm trying to avoid.

*/
if (resolveFor === TYPES_GENERATION) {
return {
title: schema.title,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we add all of the content from schema object ?

Suggested change
title: schema.title,
...schema

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, but since spread of objects wasn't supported here (due to some problem related to ES version required vs present in .eslintrc), i used it explicitly which i felt to be fine as well 😅 .

createProperties = (param) => {
const { schema } = param;
return {
description: schema.description,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Should we add title and description to the param fields ? How does this affect the types UI in the collection for the params ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't affect the types UI for params

image

@AyushShri AyushShri merged commit 2127d62 into develop Sep 24, 2025
8 checks passed
@barshan23 barshan23 deleted the feature/add-title branch September 24, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants