Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Athul0491 committed Feb 21, 2024
1 parent 2239dae commit 7100fde
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 34 deletions.
53 changes: 26 additions & 27 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,32 @@ For more specific integration options, please check out the [integration documen

<!-- toc -->

- [Usages](#usages)
- [Generator's options](#generators-options)
- [Understanding the output format](#understanding-the-output-format)
- [Generate models from AsyncAPI documents](#generate-models-from-asyncapi-documents)
- [Limitations and Compatibility](#limitations-and-compatibility)
- [Polymorphism](#polymorphism)
- [Generate models from JSON Schema documents](#generate-models-from-json-schema-documents)
- [Generate models from Swagger 2.0 documents](#generate-models-from-swagger-20-documents)
- [Limitations and Compatibility](#limitations-and-compatibility-1)
- [Polymorphism](#polymorphism-1)
- [Generate models from OpenAPI documents](#generate-models-from-openapi-documents)
- [Limitations and Compatibility](#limitations-and-compatibility-2)
- [Polymorphism](#polymorphism-2)
- [Generate models from TypeScript type files](#generate-models-from-typescript-type-files)
- [Generate models from Meta models](#generate-models-from-meta-models)
- [Generate Go models](#generate-go-models)
- [Generate C# models](#generate-c-models)
- [Generate Java models](#generate-java-models)
- [Generate TypeScript models](#generate-typescript-models)
- [Generate JavaScript models](#generate-javascript-models)
- [Generate Dart models](#generate-dart-models)
- [Generate Rust models](#generate-rust-models)
- [Generate Python models](#generate-python-models)
- [Generate Kotlin models](#generate-kotlin-models)
- [Generate C++ (cplusplus) models](#generate-c-cplusplus-models)
- [Generate PHP models](#generate-php-models)
- [Generate Scala models](#generate-scala-models)
- [Generator's options](#generators-options)
- [Understanding the output format](#understanding-the-output-format)
- [Generate models from AsyncAPI documents](#generate-models-from-asyncapi-documents)
* [Limitations and Compatibility](#limitations-and-compatibility)
+ [Polymorphism](#polymorphism)
- [Generate models from JSON Schema documents](#generate-models-from-json-schema-documents)
- [Generate models from Swagger 2.0 documents](#generate-models-from-swagger-20-documents)
* [Limitations and Compatibility](#limitations-and-compatibility-1)
+ [Polymorphism](#polymorphism-1)
- [Generate models from OpenAPI documents](#generate-models-from-openapi-documents)
+ [Limitations and Compatibility](#limitations-and-compatibility-2)
- [Polymorphism](#polymorphism-2)
- [Generate models from TypeScript type files](#generate-models-from-typescript-type-files)
- [Generate models from Meta models](#generate-models-from-meta-models)
- [Generate Go models](#generate-go-models)
- [Generate C# models](#generate-c%23-models)
- [Generate Java models](#generate-java-models)
- [Generate TypeScript models](#generate-typescript-models)
- [Generate JavaScript models](#generate-javascript-models)
- [Generate Dart models](#generate-dart-models)
- [Generate Rust models](#generate-rust-models)
- [Generate Python models](#generate-python-models)
- [Generate Kotlin models](#generate-kotlin-models)
- [Generate C++ (cplusplus) models](#generate-c-cplusplus-models)
- [Generate PHP models](#generate-php-models)
- [Generate Scala models](#generate-scala-models)

<!-- tocstop -->

Expand Down
2 changes: 1 addition & 1 deletion examples/openapi-from-object/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/openapi-v3_1-from-object/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenAPI from object
# OpenAPI 3.1 from object

A basic example of how to use Modelina with a basic OpenAPI v3.1.0 object.

Expand Down
53 changes: 53 additions & 0 deletions examples/openapi-v3_1-from-object/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Should be able to process a pure OpenAPI V3.1 object and should log expected output to console 1`] = `
Array [
"class TestPost_200ApplicationJson {
private _email?: string;
constructor(input: {
email?: string,
}) {
this._email = input.email;
}
get email(): string | undefined { return this._email; }
set email(email: string | undefined) { this._email = email; }
}",
]
`;

exports[`Should be able to process a pure OpenAPI V3.1 object and should log expected output to console 2`] = `
Array [
"class TestPostMultipartFormMinusData {
private _id?: string;
private _address?: Map<string, any>;
private _profileImage?: string;
private _additionalProperties?: Map<string, any>;
constructor(input: {
id?: string,
address?: Map<string, any>,
profileImage?: string,
additionalProperties?: Map<string, any>,
}) {
this._id = input.id;
this._address = input.address;
this._profileImage = input.profileImage;
this._additionalProperties = input.additionalProperties;
}
get id(): string | undefined { return this._id; }
set id(id: string | undefined) { this._id = id; }
get address(): Map<string, any> | undefined { return this._address; }
set address(address: Map<string, any> | undefined) { this._address = address; }
get profileImage(): string | undefined { return this._profileImage; }
set profileImage(profileImage: string | undefined) { this._profileImage = profileImage; }
get additionalProperties(): Map<string, any> | undefined { return this._additionalProperties; }
set additionalProperties(additionalProperties: Map<string, any> | undefined) { this._additionalProperties = additionalProperties; }
}",
]
`;
2 changes: 1 addition & 1 deletion examples/openapi-v3_1-from-object/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const spy = jest.spyOn(global.console, 'log').mockImplementation(() => {
return;
});
import { generate } from './index';
describe('Should be able to process a pure OpenAPI object', () => {
describe('Should be able to process a pure OpenAPI V3.1 object', () => {
afterAll(() => {
jest.restoreAllMocks();
});
Expand Down
2 changes: 1 addition & 1 deletion examples/openapi-v3_1-from-object/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/openapi-v3_1-from-object/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"config" : { "example_name" : "openapi-from-object" },
"config" : { "example_name" : "openapi-v3_1-from-object" },
"scripts": {
"install": "cd ../.. && npm i",
"start": "../../node_modules/.bin/ts-node --cwd ../../ ./examples/$npm_package_config_example_name/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7100fde

Please sign in to comment.