@accelbyte/codegen 2.0.0-beta.8 → 2.0.0

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.
@@ -323,6 +323,12 @@ class ParserUtils {
323
323
  if (definition?.schema?.type && definition.schema.type === "array") {
324
324
  return `${attrName}${required}: ${definition.schema.items.type ?? "any"}[]`;
325
325
  }
326
+ if (definition.type && definition.type === "file") {
327
+ return `${attrName}${required}: File`;
328
+ }
329
+ if (definition?.schema?.type && definition.schema.type === "file") {
330
+ return `${attrName}${required}: File`;
331
+ }
326
332
  if (definition.type && definition.type) {
327
333
  return `${attrName}${required}: ${definition.type} | null`;
328
334
  }
@@ -749,7 +755,13 @@ ${exportedTypeString}
749
755
  const schemaAttribute = name ? `'${name}':` : "";
750
756
  const typeAttribute = name ? `'${name}'${typeRequired}:` : "";
751
757
  const type = definition?.type;
752
- if (type) {
758
+ if (definition.properties) {
759
+ const result = this.parseToZodSchema(definition, requiredAttrs);
760
+ return {
761
+ schemaString: `${schemaAttribute} ${result.schemaString}${schemaRequired}`,
762
+ typeString: `${typeAttribute} ${result.typeString}${typeNullishability}`
763
+ };
764
+ } else if (type) {
753
765
  if (type === "object" && definition.additionalProperties) {
754
766
  const zodAttribute = this.parseToZodAttribute("", definition.additionalProperties, [""]);
755
767
  return {
@@ -825,12 +837,6 @@ ${exportedTypeString}
825
837
  typeString: `${typeAttribute} ${result.typeString}`
826
838
  };
827
839
  }
828
- } else if (definition.properties) {
829
- const result = this.parseToZodSchema(definition, requiredAttrs);
830
- return {
831
- schemaString: `${schemaAttribute} ${result.schemaString}${schemaRequired}`,
832
- typeString: `${typeAttribute} ${result.typeString}${typeNullishability}`
833
- };
834
840
  }
835
841
  const ref = definition.$ref;
836
842
  let model = `z.record(z.any())`;