@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.js CHANGED
@@ -886,12 +886,13 @@ function extractSchemaFromContent(content, preferredContentType) {
886
886
  * Returns the PascalCase suffix appended to a component name when resolving
887
887
  * cross-source name collisions (schemas vs. responses vs. requestBodies).
888
888
  */
889
+ const semanticSuffixes = {
890
+ schemas: "Schema",
891
+ responses: "Response",
892
+ requestBodies: "Request"
893
+ };
889
894
  function getSemanticSuffix(source) {
890
- switch (source) {
891
- case "schemas": return "Schema";
892
- case "responses": return "Response";
893
- case "requestBodies": return "Request";
894
- }
895
+ return semanticSuffixes[source];
895
896
  }
896
897
  /**
897
898
  * Builds `GetSchemasResult` without any collision detection.
@@ -1619,9 +1620,7 @@ function createOasParser(oas, { contentType, collisionDetection } = {}) {
1619
1620
  name: propName,
1620
1621
  schema: {
1621
1622
  ...schemaNode,
1622
- nullable: schemaNode.type === "null" ? void 0 : propNullable || void 0,
1623
- optional: !required && !propNullable ? true : void 0,
1624
- nullish: !required && propNullable ? true : void 0
1623
+ nullable: schemaNode.type === "null" ? void 0 : propNullable || void 0
1625
1624
  },
1626
1625
  required
1627
1626
  });
@@ -1843,8 +1842,7 @@ function createOasParser(oas, { contentType, collisionDetection } = {}) {
1843
1842
  in: param["in"],
1844
1843
  schema: {
1845
1844
  ...schema,
1846
- description: param["description"] ?? schema.description,
1847
- optional: !required || !!schema.optional ? true : void 0
1845
+ description: param["description"] ?? schema.description
1848
1846
  },
1849
1847
  required
1850
1848
  });