@rvoh/psychic 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6.1
2
+
3
+ - fix issue preventing validation fallbacks from properly overriding on OpenAPI decorator calls when explicitly opting out of validation
4
+
1
5
  ## 1.6.0
2
6
 
3
7
  enables validation to be added to both openapi configurations, as well as to `OpenAPI` decorator calls, enabling the developer to granularly control validation logic for their endpoints.
@@ -141,9 +141,11 @@ class OpenapiEndpointRenderer {
141
141
  */
142
142
  shouldValidateOpenapiPayload(openapiName, target) {
143
143
  const psychicApp = index_js_1.default.getOrFail();
144
- return (this.validate?.all ||
145
- this.validate?.[target] ||
146
- psychicApp.openapiValidationIsActive(openapiName, target));
144
+ if (this.validate?.all !== undefined)
145
+ return this.validate?.all;
146
+ if (this.validate?.[target] !== undefined)
147
+ return this.validate?.[target];
148
+ return psychicApp.openapiValidationIsActive(openapiName, target);
147
149
  }
148
150
  /**
149
151
  * @internal
@@ -135,9 +135,11 @@ export default class OpenapiEndpointRenderer {
135
135
  */
136
136
  shouldValidateOpenapiPayload(openapiName, target) {
137
137
  const psychicApp = PsychicApp.getOrFail();
138
- return (this.validate?.all ||
139
- this.validate?.[target] ||
140
- psychicApp.openapiValidationIsActive(openapiName, target));
138
+ if (this.validate?.all !== undefined)
139
+ return this.validate?.all;
140
+ if (this.validate?.[target] !== undefined)
141
+ return this.validate?.[target];
142
+ return psychicApp.openapiValidationIsActive(openapiName, target);
141
143
  }
142
144
  /**
143
145
  * @internal
@@ -558,7 +558,7 @@ export interface OpenapiEndpointRendererOpts<I extends DreamSerializable | Dream
558
558
  * }
559
559
  * ```
560
560
  */
561
- validate?: OpenapiValidateOption;
561
+ validate?: OpenapiValidateOption | undefined;
562
562
  }
563
563
  export type OpenapiValidateOption = {
564
564
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "name": "@rvoh/psychic",
4
4
  "description": "Typescript web framework",
5
- "version": "1.6.0",
5
+ "version": "1.6.1",
6
6
  "author": "RVOHealth",
7
7
  "repository": {
8
8
  "type": "git",