Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE: fix refdescription forwarded on the wrong level #112

Merged

Conversation

mtseluiko
Copy link
Contributor

No description provided.

case 'map':
return convertMap(schema);
case 'array':
return convertArray(schema);
case 'fixed':
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just reordered to make named type last in switch

@@ -315,7 +290,7 @@ const handleField = (name, field) => {
name: prepareName(name),
type: _.isArray(typeSchema.type) ? typeSchema.type : typeSchema,
default: !_.isUndefined(defaultValue) ? defaultValue : typeSchema?.default,
doc: description,
doc: field.$ref ? refDescription : description,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

here is the main change

* key of this property is our custom property name on the schema type level, value is the Avro name of this property
* @returns {Object}
*/
const convertNamedType = (schema, schemaTypeKeysMap = {}) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved similar logic for named types to one method

if (!_.isPlainObject(obj)) {
return obj;
}
schema1 = filterAttributes(schema1, schema1.type);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rewrited check for similarity of two schemas for named types

setDurationSize,
addMetaProperties,
])(attributes);
let fieldAttributes = filterAttributes(attributes, type);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just get rid from flow - debugging of this is painfull for now. And as I reordered arguments in filterAttributes - it's not so appliable for _.flow now

@@ -60,7 +60,7 @@ const getAvroType = type => {
};

const convertDescriptionToDoc = schema => {
const description = (schema.$ref && schema.refDescription) || schema.description;
const description = schema.description;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the logic for refDescription is now in field handler

@mtseluiko mtseluiko merged commit 19ab6c7 into master Jul 13, 2023
@mtseluiko mtseluiko deleted the HCK-3720-avro-fe-refdescription-forwarded-on-the-wrong-lev branch July 13, 2023 14:14
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.

1 participant