Skip to content

object renames do not appear in describe api. #1026

@WesTyler

Description

@WesTyler

Context

  • node version: 4.4.0, 4.5.0, 6.9.0
  • joi version: 9.2.0
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce ?

We are building a utility around Joi schema, utilizing the describe() api. Our expectation is that actions that modify/mutate properties should appear in the describe'ed schema.

const schema = Joi.object().keys({b: Joi.number()}).rename('a', 'b');
const schemaDescription = schema.describe();

Which result you had ?

//schemaDescription:
{ 
    type: 'object',
    children: { 
        b: { type: 'number', invalids: [ Infinity, -Infinity ] }
    }
}

What did you expect ?

Some property in schemaDescription.children.b that indicates a rename has been defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions