Skip to content

Commit

Permalink
Fix nit & update ete test snapshot.
Browse files Browse the repository at this point in the history
  • Loading branch information
eyw520 committed Nov 14, 2024
1 parent b1cdb4b commit c04849f
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ export function buildQueryParameter({
queryParameterSchema.availability = convertAvailability(queryParameter.availability);
}

if (typeof typeReference.value === "object" && "type" in typeReference.value) {
const detailedSchema = typeReference.value as RawSchemas.TypeReferenceDetailedSchema;
if (detailedSchema.validation !== undefined) {
queryParameterSchema.validation = detailedSchema.validation;
if (isRawTypeReferenceDetailedSchema(typeReference.value)) {
if (typeReference.value.validation !== undefined) {
queryParameterSchema.validation = typeReference.value.validation;
}
}

Expand Down Expand Up @@ -432,3 +431,9 @@ function hasSamePrimitiveValueType({ array, primitive }: { array: Schema; primit
array.value.schema.type === primitive.schema.type
);
}

function isRawTypeReferenceDetailedSchema(
rawTypeReference: RawSchemas.TypeReferenceSchema
): rawTypeReference is RawSchemas.TypeReferenceDetailedSchema {
return (rawTypeReference as RawSchemas.TypeReferenceDetailedSchema).type != null;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`help > no arguments 1`] = `
"fern-dev
"(node:21283) [DEP0040] DeprecationWarning: The \`punycode\` module is deprecated. Please use a userland alternative instead.
(Use \`node --trace-deprecation ...\` to show where the warning was created)
fern-dev
Commands:
fern-dev init Initialize a Fern API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ service:
limit:
docs: How many items to return at one time (max 100)
type: optional<integer>
validation:
max: 100
response:
docs: A paged array of pets
type: root.Pets
Expand Down Expand Up @@ -172,6 +174,8 @@ service:
limit:
docs: How many items to return at one time (max 100)
type: optional<integer>
validation:
max: 100
response:
docs: A paged array of pets
type: root.Pets
Expand Down Expand Up @@ -308,6 +312,8 @@ service:
limit:
docs: How many items to return at one time (max 100)
type: optional<integer>
validation:
max: 100
response:
docs: A paged array of pets
type: neopetsRoot.Pets
Expand Down Expand Up @@ -1462,12 +1468,16 @@ service:
destination:
docs: The ID of the destination station
type: string
validation:
format: uuid
dogs:
docs: Only return trips where dogs are known to be allowed
type: optional<boolean>
origin:
docs: The ID of the origin station
type: string
validation:
format: uuid
response:
docs: A list of available train trips
type: GetTripsResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ service:
limit:
docs: How many items to return at one time (max 100)
type: optional<integer>
validation:
max: 100
response:
docs: A paged array of pets
type: root.Pets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ service:
limit:
docs: How many items to return at one time (max 100)
type: optional<integer>
validation:
max: 100
response:
docs: A paged array of pets
type: neopetsRoot.Pets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ service:
destination:
docs: The ID of the destination station
type: string
validation:
format: uuid
dogs:
docs: Only return trips where dogs are known to be allowed
type: optional<boolean>
origin:
docs: The ID of the origin station
type: string
validation:
format: uuid
response:
docs: A list of available train trips
type: GetTripsResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ service:
limit:
docs: How many items to return at one time (max 100)
type: optional<integer>
validation:
max: 100
response:
docs: A paged array of pets
type: root.Pets
Expand Down

0 comments on commit c04849f

Please sign in to comment.