@kubb/adapter-oas 5.0.0-alpha.13 → 5.0.0-alpha.14

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/dist/index.cjs CHANGED
@@ -914,12 +914,13 @@ function extractSchemaFromContent(content, preferredContentType) {
914
914
  * Returns the PascalCase suffix appended to a component name when resolving
915
915
  * cross-source name collisions (schemas vs. responses vs. requestBodies).
916
916
  */
917
+ const semanticSuffixes = {
918
+ schemas: "Schema",
919
+ responses: "Response",
920
+ requestBodies: "Request"
921
+ };
917
922
  function getSemanticSuffix(source) {
918
- switch (source) {
919
- case "schemas": return "Schema";
920
- case "responses": return "Response";
921
- case "requestBodies": return "Request";
922
- }
923
+ return semanticSuffixes[source];
923
924
  }
924
925
  /**
925
926
  * Builds `GetSchemasResult` without any collision detection.
@@ -1647,9 +1648,7 @@ function createOasParser(oas, { contentType, collisionDetection } = {}) {
1647
1648
  name: propName,
1648
1649
  schema: {
1649
1650
  ...schemaNode,
1650
- nullable: schemaNode.type === "null" ? void 0 : propNullable || void 0,
1651
- optional: !required && !propNullable ? true : void 0,
1652
- nullish: !required && propNullable ? true : void 0
1651
+ nullable: schemaNode.type === "null" ? void 0 : propNullable || void 0
1653
1652
  },
1654
1653
  required
1655
1654
  });
@@ -1871,8 +1870,7 @@ function createOasParser(oas, { contentType, collisionDetection } = {}) {
1871
1870
  in: param["in"],
1872
1871
  schema: {
1873
1872
  ...schema,
1874
- description: param["description"] ?? schema.description,
1875
- optional: !required || !!schema.optional ? true : void 0
1873
+ description: param["description"] ?? schema.description
1876
1874
  },
1877
1875
  required
1878
1876
  });