-
Notifications
You must be signed in to change notification settings - Fork 16
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
FE: fix refdescription forwarded on the wrong level #112
Conversation
case 'map': | ||
return convertMap(schema); | ||
case 'array': | ||
return convertArray(schema); | ||
case 'fixed': |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 = {}) => { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
No description provided.