ftd.json
#1035
amitu
started this conversation in
Ideas & RFCs
`ftd.json`
#1035
Replies: 3 comments 3 replies
-
Is this a correct example?:
Output: {
"id": 1,
"name": "jack",
"age": 20
} Example: Multiple Users
This will output: [
{
"id": 1,
"name": "jack",
"age": 20
},
{
"id": 2,
"name": "jill",
"age": 21
}
] |
Beta Was this translation helpful? Give feedback.
1 reply
-
We should treat the body of ftd.json as f-script that evaluated to an object. F-script means body of functions in fastn. It should allow everything that is allowed in function bodies. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Updated Example: Multiple Users
This will output: [
{
"id": 1,
"name": "jack",
"age": 20
},
{
"id": 2,
"name": "jill",
"age": 21
}
] |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Status: We have implemented
ftd.json
:This works, it generates JSON like:
You can also use
if
withftd.json
.NOTE: We are no longer planning to do what's in the rest of this discussion, and are going in the type safe templating/json generation direction.
Note: This is part of backend using ftd.
We should allow
in ftd documents.
ftd.json
likeftd.document
can not be repeated in one document. If accept header is content/json we returnftd.json
as JSON.Beta Was this translation helpful? Give feedback.
All reactions