Skip to content

YAML inheritance #53

@seanpdoyle

Description

@seanpdoyle

Is there any way to DRY up the fdoc response YAML files? I'd love to use something like YAML inheritance, but it doesn't seem to work.

I find myself constantly copy pasting YAMLs across PUT/POST/GET actions

it would be nice to somehow declare a base and have it shared across files

blogPostProperties: &blogPost
  title:
    description: the post title
    required: yes
    type: string
    example: Hello World Post!
  published:
    description: is it published?
    required: yes
    type: boolean
    example: false

Then, elsewhere in (another file) inherit the properties

# fdoc/blogPosts/:id-GET.fdoc
# ...
responseParameters:
  properties:
    blogPost:
      description: the post
      required: true
      type: object
      properties: *blogPost
        # include the base properties, then additionally include some others
        created_at:
          description: the date created
          required: true
          type: date
          example: 'TODAY'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions