Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DeviceConnectCodegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DeviceConnect Codegenは、DeviceConnectシステム上で動作するプラグ
|samples/profiles-specs|シェルスクリプトのサンプルに入力するプロファイル定義ファイル群。|

## Get Started
[deviceconnect-codegen-project-1.5.0-dist.zip](https://github.com/TakayukiHoshi1984/DeviceConnect-Experiments/releases/tag/codegen-v1.5.0) をPC上の任意の場所にダウンロードし、解凍してください。
[deviceconnect-codegen-project-1.5.1-dist.zip](https://github.com/TakayukiHoshi1984/DeviceConnect-Experiments/releases/tag/codegen-v1.5.1) をPC上の任意の場所にダウンロードし、解凍してください。

解凍後、ターミナルを起動し、以下のコマンドによりをサンプルのスケルトンコードを生成してください。

Expand Down Expand Up @@ -156,6 +156,7 @@ java -jar bin/deviceconnect-codegen.jar [オプション]
<tr>
<td valign="top"><pre>--display-name</pre></td>
<td valign="top">
<b>[プラグインまたはアプリケーションのみ有効]</b><br>
スケルトンコードの名前の指定。<br>
<br>
プラグインの場合、System APIによって取得できるデバイスプラグインの名前として使用される。アプリケーションの場合、主にアプリケーションのタイトルとして表示する名前として使用される。<br>
Expand Down
3 changes: 3 additions & 0 deletions DeviceConnectCodegen/RELEASENOTE.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 変更履歴
2017/12/20: v1.5.1 [Markdown][HTML] 不具合修正: APIリファレンスの「概要」が空の状態で出力される
[共通] 不具合修正: input-specオプションにYAML形式のファイルを指定すると異常終了

2017/11/30: v1.5.0 [Android] DeviceConnectManagerへの複数プラグイン同梱仕様対応
[共通] エラーメッセージの詳細化
[共通] 不具合修正: basePathの長さが1のプロファイルを定義した場合に異常終了
Expand Down
2 changes: 1 addition & 1 deletion DeviceConnectCodegen/modules/deviceconnect-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.deviceconnect</groupId>
<artifactId>deviceconnect-codegen</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.github.fge.jsonschema.core.exceptions.ProcessingException;
import config.Config;
import config.ConfigParser;
Expand Down Expand Up @@ -273,7 +274,17 @@ public File writeToFile(final String filename, final String contents) throws IOE
}

private static boolean checkSwagger(final File file) throws IOException, ProcessingException {
JsonNode jsonNode = new ObjectMapper().readTree(file);
String fileName = file.getName();
ObjectMapper mapper;
if (fileName.endsWith(".yaml")) {
mapper = new ObjectMapper(new YAMLFactory());
} else if (fileName.endsWith(".json")) {
mapper = new ObjectMapper();
} else {
throw new IllegalArgumentException("file must be JSON or YAML.");
}

JsonNode jsonNode = mapper.readTree(file);
SwaggerJsonValidator.Result result = JSON_VALIDATOR.validate(jsonNode);
if (result.isSuccess()) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion DeviceConnectCodegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.deviceconnect</groupId>
<artifactId>deviceconnect-codegen-project</artifactId>
<version>1.5.0</version>
<version>1.5.1</version>

<packaging>pom</packaging>

Expand Down