-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(annotations): fixed failing test
- Loading branch information
Showing
15 changed files
with
246 additions
and
60 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
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
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 @@ | ||
import 'package:args/command_runner.dart'; | ||
import 'package:openapi_generator_cli/src/models.dart'; | ||
|
||
class GenerateCommand extends Command { | ||
// The [name] and [description] properties must be defined by every | ||
// subclass. | ||
final name = "generate"; | ||
final description = "Record changes to the repository."; | ||
|
||
CommitCommand() { | ||
// Add options based on ConfigDefaults and ConfigKeys | ||
argParser.addOption(ConfigKeys.openapiGeneratorVersion, | ||
help: 'The version of the OpenAPI generator to use.', | ||
defaultsTo: ConfigDefaults.openapiGeneratorVersion); | ||
|
||
argParser.addOption(ConfigKeys.additionalCommands, | ||
help: | ||
'Additional commands to pass to the generator. This command will be appended at the end of the commands pas', | ||
defaultsTo: ConfigDefaults.additionalCommands); | ||
|
||
argParser.addOption(ConfigKeys.downloadUrlOverride, | ||
help: 'A custom URL to override the default download location.', | ||
defaultsTo: ConfigDefaults.downloadUrlOverride); | ||
|
||
argParser.addOption(ConfigKeys.jarCachePath, | ||
help: 'The directory where the JAR cache will be stored.', | ||
defaultsTo: ConfigDefaults.jarCacheDir); | ||
|
||
argParser.addMultiOption(ConfigKeys.customGeneratorUrls, | ||
help: | ||
'Urls for the jars of additional OpenAPI generators to combine with the official one.', | ||
defaultsTo: ConfigDefaults.customGeneratorUrls); | ||
} | ||
|
||
// [run] may also return a Future. | ||
void run() { | ||
// [argResults] is set before [run()] is called and contains the flags/options | ||
// passed to this command. | ||
print(argResults?.option('all')); | ||
} | ||
} |
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,19 @@ | ||
/// Default configuration values | ||
class ConfigDefaults { | ||
static const openapiGeneratorVersion = '7.9.0'; | ||
static const additionalCommands = ''; | ||
static const downloadUrlOverride = null; | ||
static const jarCacheDir = '.dart_tool/openapi_generator_cache'; | ||
static const customGeneratorUrls = <String>[ | ||
'https://repo1.maven.org/maven2/com/bluetrainsoftware/maven/openapi-dart-generator/7.2/openapi-dart-generator-7.2.jar' | ||
]; | ||
} | ||
|
||
/// Configuration keys as static constants | ||
class ConfigKeys { | ||
static const openapiGeneratorVersion = 'openapiGeneratorVersion'; | ||
static const additionalCommands = 'additionalCommands'; | ||
static const downloadUrlOverride = 'downloadUrlOverride'; | ||
static const jarCachePath = 'jarCacheDir'; | ||
static const customGeneratorUrls = 'customGeneratorUrls'; | ||
} |
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
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
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
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
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
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,4 @@ | ||
type: object | ||
properties: | ||
optionA1: | ||
type: string |
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,4 @@ | ||
type: object | ||
properties: | ||
optionB1: | ||
type: string |
15 changes: 15 additions & 0 deletions
15
openapi-generator/test/specs/issue/167/github_issue_#167.yaml
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 @@ | ||
openapi: 3.0.3 | ||
info: | ||
version: '1.0' | ||
title: Test | ||
paths: | ||
/test: | ||
get: | ||
operationId: test | ||
responses: | ||
'200': | ||
description: response | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "./test.yml" |
Oops, something went wrong.