Skip to content

Commit

Permalink
(fix): add richer information for strings, integers and doubles (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored May 1, 2024
1 parent 6020e12 commit fae0f5d
Show file tree
Hide file tree
Showing 31 changed files with 205 additions and 19 deletions.
25 changes: 22 additions & 3 deletions fern/apis/fdr/definition/api/v1/read/type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,35 @@ types:

PrimitiveType:
union:
integer: {}
double: {}
integer: IntegerType
double: DoubleType
long: {}
string: {}
string: StringType
boolean: {}
datetime: {}
uuid: {}
base64: {}
date: {}

IntegerType:
properties:
minimum: optional<integer>
maximum: optional<integer>
default: optional<integer>

DoubleType:
properties:
minimum: optional<double>
maximum: optional<double>
default: optional<double>

StringType:
properties:
regex: optional<string>
minLength: optional<integer>
maxLength: optional<integer>
default: optional<string>

OptionalType:
properties:
itemType: TypeReference
Expand Down
25 changes: 22 additions & 3 deletions fern/apis/fdr/definition/api/v1/register/type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,35 @@ types:

PrimitiveType:
union:
integer: {}
double: {}
integer: IntegerType
double: DoubleType
long: {}
string: {}
string: StringType
boolean: {}
datetime: {}
uuid: {}
base64: {}
date: {}

IntegerType:
properties:
minimum: optional<integer>
maximum: optional<integer>
default: optional<integer>

DoubleType:
properties:
minimum: optional<double>
maximum: optional<double>
default: optional<double>

StringType:
properties:
regex: optional<string>
minLength: optional<integer>
maxLength: optional<integer>
default: optional<string>

OptionalType:
properties:
itemType: TypeReference
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface DoubleType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface IntegerType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ export type PrimitiveType =
| FernRegistry.api.v1.read.PrimitiveType.Date_;

export declare namespace PrimitiveType {
interface Integer {
interface Integer extends FernRegistry.api.v1.read.IntegerType {
type: "integer";
}

interface Double {
interface Double extends FernRegistry.api.v1.read.DoubleType {
type: "double";
}

interface Long {
type: "long";
}

interface String {
interface String extends FernRegistry.api.v1.read.StringType {
type: "string";
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface StringType {
regex?: string;
minLength?: number;
maxLength?: number;
default?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export * from "./ObjectType";
export * from "./PropertyKey";
export * from "./ObjectProperty";
export * from "./PrimitiveType";
export * from "./IntegerType";
export * from "./DoubleType";
export * from "./StringType";
export * from "./OptionalType";
export * from "./ListType";
export * from "./SetType";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface DoubleType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface IntegerType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ export type PrimitiveType =
| FernRegistry.api.v1.register.PrimitiveType.Date_;

export declare namespace PrimitiveType {
interface Integer {
interface Integer extends FernRegistry.api.v1.register.IntegerType {
type: "integer";
}

interface Double {
interface Double extends FernRegistry.api.v1.register.DoubleType {
type: "double";
}

interface Long {
type: "long";
}

interface String {
interface String extends FernRegistry.api.v1.register.StringType {
type: "string";
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface StringType {
regex?: string;
minLength?: number;
maxLength?: number;
default?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export * from "./ObjectType";
export * from "./PropertyKey";
export * from "./ObjectProperty";
export * from "./PrimitiveType";
export * from "./IntegerType";
export * from "./DoubleType";
export * from "./StringType";
export * from "./OptionalType";
export * from "./ListType";
export * from "./SetType";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import lodash from "lodash";
import { APIV1Db, APIV1Read, APIV1Write, FdrAPI } from "../../client";
import { WithoutQuestionMarks } from "../utils/WithoutQuestionMarks";
import { assertNever } from "../utils/assertNever";
import { titleCase } from "../utils/titleCase";
import { WithoutQuestionMarks } from "../utils/WithoutQuestionMarks";
import {
generateEndpointErrorExample,
generateEndpointNonStreamResponseExample,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export interface DoubleType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export interface IntegerType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import * as FernRegistry from "../../../../../../../../..";
export declare type PrimitiveType = FernRegistry.api.v1.read.PrimitiveType.Integer | FernRegistry.api.v1.read.PrimitiveType.Double | FernRegistry.api.v1.read.PrimitiveType.Long | FernRegistry.api.v1.read.PrimitiveType.String | FernRegistry.api.v1.read.PrimitiveType.Boolean | FernRegistry.api.v1.read.PrimitiveType.Datetime | FernRegistry.api.v1.read.PrimitiveType.Uuid | FernRegistry.api.v1.read.PrimitiveType.Base64 | FernRegistry.api.v1.read.PrimitiveType.Date_;
export declare namespace PrimitiveType {
interface Integer {
interface Integer extends FernRegistry.api.v1.read.IntegerType {
type: "integer";
}
interface Double {
interface Double extends FernRegistry.api.v1.read.DoubleType {
type: "double";
}
interface Long {
type: "long";
}
interface String {
interface String extends FernRegistry.api.v1.read.StringType {
type: "string";
}
interface Boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export interface StringType {
regex?: string;
minLength?: number;
maxLength?: number;
default?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export * from "./ObjectType";
export * from "./PropertyKey";
export * from "./ObjectProperty";
export * from "./PrimitiveType";
export * from "./IntegerType";
export * from "./DoubleType";
export * from "./StringType";
export * from "./OptionalType";
export * from "./ListType";
export * from "./SetType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export * from "./ObjectType";
export * from "./PropertyKey";
export * from "./ObjectProperty";
export * from "./PrimitiveType";
export * from "./IntegerType";
export * from "./DoubleType";
export * from "./StringType";
export * from "./OptionalType";
export * from "./ListType";
export * from "./SetType";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export interface DoubleType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export interface IntegerType {
minimum?: number;
maximum?: number;
default?: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import * as FernRegistry from "../../../../../../../../..";
export declare type PrimitiveType = FernRegistry.api.v1.register.PrimitiveType.Integer | FernRegistry.api.v1.register.PrimitiveType.Double | FernRegistry.api.v1.register.PrimitiveType.Long | FernRegistry.api.v1.register.PrimitiveType.String | FernRegistry.api.v1.register.PrimitiveType.Boolean | FernRegistry.api.v1.register.PrimitiveType.Datetime | FernRegistry.api.v1.register.PrimitiveType.Uuid | FernRegistry.api.v1.register.PrimitiveType.Base64 | FernRegistry.api.v1.register.PrimitiveType.Date_;
export declare namespace PrimitiveType {
interface Integer {
interface Integer extends FernRegistry.api.v1.register.IntegerType {
type: "integer";
}
interface Double {
interface Double extends FernRegistry.api.v1.register.DoubleType {
type: "double";
}
interface Long {
type: "long";
}
interface String {
interface String extends FernRegistry.api.v1.register.StringType {
type: "string";
}
interface Boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export interface StringType {
regex?: string;
minLength?: number;
maxLength?: number;
default?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
export {};
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export * from "./ObjectType";
export * from "./PropertyKey";
export * from "./ObjectProperty";
export * from "./PrimitiveType";
export * from "./IntegerType";
export * from "./DoubleType";
export * from "./StringType";
export * from "./OptionalType";
export * from "./ListType";
export * from "./SetType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export * from "./ObjectType";
export * from "./PropertyKey";
export * from "./ObjectProperty";
export * from "./PrimitiveType";
export * from "./IntegerType";
export * from "./DoubleType";
export * from "./StringType";
export * from "./OptionalType";
export * from "./ListType";
export * from "./SetType";
Expand Down

0 comments on commit fae0f5d

Please sign in to comment.