mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 23:27:31 +00:00
build(server): the response-contract exempt marker only excuses a handler that writes through @Res()
A response-contract-exempt comment counted any handler as covered, whatever it returned, so one comment line let a JSON handler past the ratchet. The marker now counts only on a handler taking @Res() or @Next(). The five vacay holiday proxies return the provider's JSON, so they lose their markers and are counted again until they declare a schema.
This commit is contained in:
@@ -360,28 +360,28 @@ export class VacayController {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
// response-contract-exempt: passes the holiday provider's answer through as it came; its shape is the provider's.
|
||||
// No contract yet: passes the holiday provider's answer through as it came, so its shape is the provider's.
|
||||
@Get('holidays/countries')
|
||||
async holidayCountries() {
|
||||
const result = await this.vacay.getCountries();
|
||||
return result.data;
|
||||
}
|
||||
|
||||
// response-contract-exempt: passes the holiday provider's answer through as it came; its shape is the provider's.
|
||||
// No contract yet: passes the holiday provider's answer through as it came, so its shape is the provider's.
|
||||
@Get('holidays/:year/:country')
|
||||
async holidays(@Param('year') year: string, @Param('country') country: string) {
|
||||
const result = await this.vacay.getHolidays(year, country);
|
||||
return result.data;
|
||||
}
|
||||
|
||||
// response-contract-exempt: passes the holiday provider's answer through as it came; its shape is the provider's.
|
||||
// No contract yet: passes the holiday provider's answer through as it came, so its shape is the provider's.
|
||||
@Get('school-holidays/regions/:country')
|
||||
async schoolHolidayRegions(@Param('country') country: string) {
|
||||
const result = await this.vacay.getSchoolHolidayRegions(country, country.toUpperCase() === 'DE' ? 'DE' : 'EN');
|
||||
return result.data;
|
||||
}
|
||||
|
||||
// response-contract-exempt: passes the holiday provider's answer through as it came; its shape is the provider's.
|
||||
// No contract yet: passes the holiday provider's answer through as it came, so its shape is the provider's.
|
||||
@Get('school-holidays/:year/:country')
|
||||
async schoolHolidaysForCountry(
|
||||
@Param('year') year: string,
|
||||
@@ -391,7 +391,7 @@ export class VacayController {
|
||||
return this.schoolHolidays(year, country, undefined, group);
|
||||
}
|
||||
|
||||
// response-contract-exempt: passes the holiday provider's answer through as it came; its shape is the provider's.
|
||||
// No contract yet: passes the holiday provider's answer through as it came, so its shape is the provider's.
|
||||
@Get('school-holidays/:year/:country/:subdivision')
|
||||
async schoolHolidaysForSubdivision(
|
||||
@Param('year') year: string,
|
||||
|
||||
Reference in New Issue
Block a user