-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate sample 'ktorm-schema' project with mutable models
- Loading branch information
Showing
20 changed files
with
897 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
generatorName: ktorm-schema | ||
outputDir: samples/schema/petstore/ktorm-modelMutable | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/ktorm-schema | ||
additionalProperties: | ||
hideGenerationTimestamp: true | ||
importModelPackageName: org.openapitools.client.models | ||
modelMutable: "true" |
23 changes: 23 additions & 0 deletions
23
samples/schema/petstore/ktorm-modelMutable/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
16 changes: 16 additions & 0 deletions
16
samples/schema/petstore/ktorm-modelMutable/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
README.md | ||
build.gradle | ||
docs/ApiResponse.md | ||
docs/Category.md | ||
docs/Order.md | ||
docs/Pet.md | ||
docs/Tag.md | ||
docs/User.md | ||
ktorm_schema.sql | ||
settings.gradle | ||
src/main/kotlin/org/openapitools/database/models/ApiResponse.kt | ||
src/main/kotlin/org/openapitools/database/models/Category.kt | ||
src/main/kotlin/org/openapitools/database/models/Order.kt | ||
src/main/kotlin/org/openapitools/database/models/Pet.kt | ||
src/main/kotlin/org/openapitools/database/models/Tag.kt | ||
src/main/kotlin/org/openapitools/database/models/User.kt |
1 change: 1 addition & 0 deletions
1
samples/schema/petstore/ktorm-modelMutable/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5.4.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# org.openapitools.database - Kotlin database library for OpenAPI Petstore | ||
|
||
## Requires | ||
|
||
|
||
## Build | ||
|
||
``` | ||
./gradlew check assemble | ||
``` | ||
|
||
This runs all tests and packages the library. | ||
|
||
## Features/Implementation Notes | ||
|
||
* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. | ||
* Supports Mapper using API model classes. | ||
* Supports SQLite types. | ||
|
||
<a name="documentation-for-models"></a> | ||
## Documentation for Models | ||
|
||
- [org.openapitools.database.models.ApiResponse](docs/ApiResponse.md) | ||
- [org.openapitools.database.models.Category](docs/Category.md) | ||
- [org.openapitools.database.models.Order](docs/Order.md) | ||
- [org.openapitools.database.models.Pet](docs/Pet.md) | ||
- [org.openapitools.database.models.Tag](docs/Tag.md) | ||
- [org.openapitools.database.models.User](docs/User.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
group 'org.openapitools' | ||
version '1.0.0' | ||
|
||
wrapper { | ||
gradleVersion = '4.9' | ||
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" | ||
} | ||
|
||
buildscript { | ||
ext.kotlin_version = '1.3.72' | ||
ext.ktorm_version = '3.2.0' | ||
|
||
repositories { | ||
maven { url "https://repo1.maven.org/maven2" } | ||
} | ||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
apply plugin: 'kotlin' | ||
|
||
repositories { | ||
maven { url "https://repo1.maven.org/maven2" } | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
implementation "org.ktorm:ktorm-core:$ktorm_version" | ||
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" | ||
} |
15 changes: 15 additions & 0 deletions
15
samples/schema/petstore/ktorm-modelMutable/docs/ApiResponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
# Table `ApiResponse` | ||
(mapped from: ApiResponse) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
**code** | code | int | | **kotlin.Int** | | [optional] | ||
**type** | type | text | | **kotlin.String** | | [optional] | ||
**message** | message | text | | **kotlin.String** | | [optional] | ||
|
||
|
||
|
||
|
||
|
13 changes: 13 additions & 0 deletions
13
samples/schema/petstore/ktorm-modelMutable/docs/Category.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
# Table `Category` | ||
(mapped from: Category) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
**id** | id | long PRIMARY KEY AUTOINCREMENT | | **kotlin.Long** | | [optional] | ||
**name** | name | text | | **kotlin.String** | | [optional] | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
# Table `Order` | ||
(mapped from: Order) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
**id** | id | long PRIMARY KEY AUTOINCREMENT | | **kotlin.Long** | | [optional] | ||
**petId** | petId | long | | **kotlin.Long** | | [optional] | ||
**quantity** | quantity | int | | **kotlin.Int** | | [optional] | ||
**shipDate** | shipDate | datetime | | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] | ||
**status** | status | text | | [**status**](#Status) | Order Status | [optional] | ||
**complete** | complete | boolean | | **kotlin.Boolean** | | [optional] | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
# Table `Pet` | ||
(mapped from: Pet) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
**name** | name | text NOT NULL | | **kotlin.String** | | | ||
**photoUrls** | `One-To-Many` | `----` | `----` | **kotlin.Array<kotlin.String>** | | | ||
**id** | id | long PRIMARY KEY AUTOINCREMENT | | **kotlin.Long** | | [optional] | ||
**category** | category | long | | [**Category**](Category.md) | | [optional] [foreignkey] | ||
**tags** | `One-To-Many` | `----` | `----` | [**kotlin.Array<Tag>**](Tag.md) | | [optional] | ||
**status** | status | text | | [**status**](#Status) | pet status in the store | [optional] | ||
|
||
|
||
|
||
# **Table `PetPhotoUrls`** | ||
(mapped from: PetPhotoUrls) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
pet | pet | long | | kotlin.Long | Primary Key | *one* | ||
photoUrls | photoUrls | text | | kotlin.String | Foreign Key | *many* | ||
|
||
|
||
|
||
|
||
|
||
# **Table `PetTag`** | ||
(mapped from: PetTag) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
pet | pet | long | | kotlin.Long | Primary Key | *one* | ||
tag | tag | long | | kotlin.Long | Foreign Key | *many* | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
# Table `Tag` | ||
(mapped from: Tag) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
**id** | id | long PRIMARY KEY AUTOINCREMENT | | **kotlin.Long** | | [optional] | ||
**name** | name | text | | **kotlin.String** | | [optional] | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
# Table `User` | ||
(mapped from: User) | ||
|
||
## Properties | ||
Name | Mapping | SQL Type | Default | Type | Description | Notes | ||
---- | ------- | -------- | ------- | ---- | ----------- | ----- | ||
**id** | id | long PRIMARY KEY AUTOINCREMENT | | **kotlin.Long** | | [optional] | ||
**username** | username | text | | **kotlin.String** | | [optional] | ||
**firstName** | firstName | text | | **kotlin.String** | | [optional] | ||
**lastName** | lastName | text | | **kotlin.String** | | [optional] | ||
**email** | email | text | | **kotlin.String** | | [optional] | ||
**password** | password | text | | **kotlin.String** | | [optional] | ||
**phone** | phone | text | | **kotlin.String** | | [optional] | ||
**userStatus** | userStatus | int | | **kotlin.Int** | User Status | [optional] | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.