Skip to content

Support metadata for schema documentation #4

@andrenarchy

Description

@andrenarchy

A fefe function could return metadata about what it is doing, for example for

import { date } from 'fefe'
const validateReleaseDate = date({ min: new Date() })

the resulting function could offer a function validateReleaseDate.describe() that returns something like

{
  params: { min: Date(2019-02-26) },
  description: 'A date after 2019-02-26.'
}

The user could also provide a semantic description via

date({ min: new Date(), description: 'The release date.' })

or a function that can use the standard description

date({ min: new Date(), description: msg => `The release date: ${msg}` })

CC @andywer :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions