syncano-node
syncano-node copied to clipboard
Fields method based on schema definition
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 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?