4

Version 2.4 release notes

 3 years ago
source link: https://foalts.org/blog/2021/05/19/version-2.4-release-notes/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Version 2.4 release notes

May 19, 2021 · 2 min read

Loïc Poullain

Fullstack developper and creator of FoalTS

Banner

Version 2.4 of Foal has been released! Here are the improvements that it brings.

$data references for validation#

Version 2.4 allows you to enable the AJV $data option so that you can use the verified data values as validators for other values.

config/default.json

Example of auth controller

import { Context, Post, ValidateBody } from '@foal/core';
export class AuthController {
@Post('/signup')
@ValidateBody({
type: 'object',
properties: {
username: { type: 'string' },
password: { type: 'string' },
// "password" and "confirmPassword" should be identical.
confirmPassword: {
const: {
$data: '1/password',
type: 'string',
required: [ 'username', 'password', 'confirmPassword' ],
additionalProperties: false
signup(ctx: Context) {
// Do something.

Cache option for file downloading#

Starting from version 2.4 the Disk.createHttpResponse method accepts an optional parameter to specify the value of the Cache-Control header.

Bug fixes#

See issue #930.

Contributors#

@ZakRabe

Share this article on
Stay up to date with the newsletter.
Tags:release

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK