Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Nov 18, 2024
2 parents 260801e + d0825cc commit 70cea1b
Show file tree
Hide file tree
Showing 54 changed files with 354 additions and 30 deletions.
5 changes: 0 additions & 5 deletions .changeset/shy-planes-mate.md

This file was deleted.

7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @kubb/cli

## 3.0.8

### Patch Changes

- Updated dependencies []:
- @kubb/core@3.0.8

## 3.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/cli",
"version": "3.0.7",
"version": "3.0.8",
"description": "Generator cli",
"keywords": [
"typescript",
Expand Down
2 changes: 2 additions & 0 deletions packages/config-biome/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @kubb/config-biome

## 3.0.8

## 3.0.7

## 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/config-biome/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/config-biome",
"version": "3.0.7",
"version": "3.0.8",
"private": true,
"type": "module",
"exports": {
Expand Down
2 changes: 2 additions & 0 deletions packages/config-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @kubb/config-ts

## 3.0.8

## 3.0.7

## 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/config-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/config-ts",
"version": "3.0.7",
"version": "3.0.8",
"private": true,
"types": "./reset.d.ts",
"files": [
Expand Down
2 changes: 2 additions & 0 deletions packages/config-tsup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @kubb/config-tsup

## 3.0.8

## 3.0.7

## 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/config-tsup/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/config-tsup",
"version": "3.0.7",
"version": "3.0.8",
"private": true,
"sideEffects": false,
"type": "module",
Expand Down
9 changes: 9 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @kubb/core

## 3.0.8

### Patch Changes

- Updated dependencies []:
- @kubb/fs@3.0.8
- @kubb/parser-ts@3.0.8
- @kubb/types@3.0.8

## 3.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/core",
"version": "3.0.7",
"version": "3.0.8",
"description": "Generator core",
"keywords": [
"typescript",
Expand Down
2 changes: 2 additions & 0 deletions packages/fs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @kubb/fs

## 3.0.8

## 3.0.7

## 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/fs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/fs",
"version": "3.0.7",
"version": "3.0.8",
"description": "FileSystem helpers",
"keywords": [
"typescript",
Expand Down
8 changes: 8 additions & 0 deletions packages/kubb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# kubb

## 3.0.8

### Patch Changes

- Updated dependencies []:
- @kubb/cli@3.0.8
- @kubb/core@3.0.8

## 3.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/kubb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kubb",
"version": "3.0.7",
"version": "3.0.8",
"description": "OpenAPI to TypeScript, React-Query, Zod, Zodios, Faker.js, MSW and Axios.",
"keywords": [
"typescript",
Expand Down
2 changes: 2 additions & 0 deletions packages/oas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @kubb/oas

## 3.0.8

## 3.0.7

## 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/oas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/oas",
"version": "3.0.7",
"version": "3.0.8",
"description": "Oas helpers",
"keywords": [
"typescript",
Expand Down
2 changes: 2 additions & 0 deletions packages/parser-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @kubb/parser-ts

## 3.0.8

## 3.0.7

## 3.0.6
Expand Down
2 changes: 1 addition & 1 deletion packages/parser-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/parser-ts",
"version": "3.0.7",
"version": "3.0.8",
"description": "TypeScript parser",
"keywords": [
"typescript",
Expand Down
13 changes: 13 additions & 0 deletions packages/plugin-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @kubb/plugin-client

## 3.0.8

### Patch Changes

- Updated dependencies [[`569cff0`](https://github.com/kubb-labs/kubb/commit/569cff0a6402830870c3aab7210acdb123b17c48)]:
- @kubb/plugin-zod@3.0.8
- @kubb/core@3.0.8
- @kubb/fs@3.0.8
- @kubb/oas@3.0.8
- @kubb/plugin-oas@3.0.8
- @kubb/plugin-ts@3.0.8
- @kubb/react@3.0.8

## 3.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/plugin-client",
"version": "3.0.7",
"version": "3.0.8",
"description": "Generator plugin-client",
"keywords": [
"typescript",
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-faker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @kubb/plugin-faker

## 3.0.8

### Patch Changes

- Updated dependencies []:
- @kubb/core@3.0.8
- @kubb/fs@3.0.8
- @kubb/oas@3.0.8
- @kubb/plugin-oas@3.0.8
- @kubb/plugin-ts@3.0.8
- @kubb/react@3.0.8

## 3.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-faker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/plugin-faker",
"version": "3.0.7",
"version": "3.0.8",
"description": "Generator plugin-faker",
"keywords": [
"faker",
Expand Down
13 changes: 13 additions & 0 deletions packages/plugin-msw/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @kubb/plugin-msw

## 3.0.8

### Patch Changes

- Updated dependencies []:
- @kubb/core@3.0.8
- @kubb/fs@3.0.8
- @kubb/oas@3.0.8
- @kubb/plugin-faker@3.0.8
- @kubb/plugin-oas@3.0.8
- @kubb/plugin-ts@3.0.8
- @kubb/react@3.0.8

## 3.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-msw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/plugin-msw",
"version": "3.0.7",
"version": "3.0.8",
"description": "Generator swagger",
"keywords": [
"typescript",
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-oas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @kubb/swagger

## 3.0.8

### Patch Changes

- Updated dependencies []:
- @kubb/core@3.0.8
- @kubb/fs@3.0.8
- @kubb/oas@3.0.8
- @kubb/react@3.0.8

## 3.0.7

### Patch Changes
Expand Down
17 changes: 16 additions & 1 deletion packages/plugin-oas/mocks/petStore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,22 @@ components:
type: array
items:
$ref: '#/components/schemas/Pet'

Toy:
type: object
required:
- id
properties:
id:
type: string
format: uuid
name:
type: string
description:
type: string
default: null
nullable: true
default: null
nullble: true
PageSize:
type: integer
minimum: 1
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-oas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubb/plugin-oas",
"version": "3.0.7",
"version": "3.0.8",
"description": "Generator swagger",
"keywords": [
"typescript",
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin-oas/src/SchemaGenerator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ describe('SchemaGenerator core', async () => {
unknownType: 'unknown',
},
},
{
name: 'Toy',
input: '../mocks/petStore.yaml',
path: 'Toy',
options: {
dateType: 'date',
transformers: {},
unknownType: 'unknown',
},
},
{
name: 'PageSize',
input: '../mocks/petStore.yaml',
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-oas/src/SchemaGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ export class SchemaGenerator<
const min = schema.minimum ?? schema.minLength ?? schema.minItems ?? undefined
const max = schema.maximum ?? schema.maxLength ?? schema.maxItems ?? undefined
const nullable = schema.nullable ?? schema['x-nullable'] ?? false
const defaultNullAndNullable = schema.default === null && nullable

if (schema.default !== undefined && !Array.isArray(schema.default)) {
if (schema.default !== undefined && !defaultNullAndNullable && !Array.isArray(schema.default)) {
if (typeof schema.default === 'string') {
baseItems.push({
keyword: schemaKeywords.default,
Expand Down
Loading

0 comments on commit 70cea1b

Please sign in to comment.