syncano-node icon indicating copy to clipboard operation
syncano-node copied to clipboard

Fields method based on schema definition

Open Idered opened this issue 8 years ago • 1 comments

endpoints:
  create-wish:
    parameters:
      title:
        type: string
      description:
        type: text
    response:
      success:
        exit_code: 200
        parameters:
          title:
            type: text
const wish = {
  title: 'Lorem ipsum',
  description: 'Dolor sit amet',
  uuid: '12ji21d-0ek=2-em12ednfm'
}

response.success(wish)

response.success undercover should use fields method and only return properties defined in the schema. In this case {title: 'Lorem ipsum'} should be returned.

// cc @mkucharz

Idered avatar Nov 14 '17 15:11 Idered

@Idered I have some concerns here... That can be quite confusing for some people it think. Maybe we should add option to response like strict=true or some kind of warning?

mkucharz avatar Jan 24 '18 22:01 mkucharz