Skip to content

Commit

Permalink
run "mvn formatter:format" on swagger-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Jul 13, 2017
1 parent 0416b03 commit 1e53557
Show file tree
Hide file tree
Showing 20 changed files with 216 additions and 252 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator;
Expand All @@ -32,13 +30,13 @@ public void init(ServletConfig config) throws ServletException {
DynamicSwaggerConfig bc = new DynamicSwaggerConfig();
bc.setBasePath("/api");
bc.setTitle("Swagger Generator");
bc.setDescription("This is an online swagger codegen server. You can find out more " +
"at https://github.com/swagger-api/swagger-codegen or on [irc.freenode.net, #swagger](http:https://swagger.io/irc/).");
bc.setDescription("This is an online swagger codegen server. You can find out more "
+ "at https://github.com/swagger-api/swagger-codegen or on [irc.freenode.net, #swagger](http:https://swagger.io/irc/).");
bc.setTermsOfServiceUrl("http:https://swagger.io/terms/");
bc.setContact("[email protected]");
bc.setLicense("Apache 2.0");
InputStream stream = getClass().getResourceAsStream("/version.prop");
if(stream == null) {
if (stream == null) {
bc.setVersion("0.0.0");
} else {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public class DynamicSwaggerConfig extends BeanConfig {
static {
List<CodegenConfig> extensions = Codegen.getExtensions();
for (CodegenConfig config : extensions) {
if (config.getTag().equals(CodegenType.CLIENT) || config.getTag().equals(CodegenType.DOCUMENTATION)) {
if (config.getTag().equals(CodegenType.CLIENT)
|| config.getTag().equals(CodegenType.DOCUMENTATION)) {
clients.add(config.getName());
} else if (config.getTag().equals(CodegenType.SERVER)) {
servers.add(config.getName());
Expand All @@ -44,7 +45,7 @@ public Swagger configure(Swagger swagger) {
}

Operation get = clientPath.getGet();
if(get != null) {
if (get != null) {
framework = get.getParameters().get(0);
if (framework instanceof PathParameter) {
PathParameter param = (PathParameter) framework;
Expand All @@ -63,7 +64,7 @@ public Swagger configure(Swagger swagger) {
}

Operation get = serverPath.getGet();
if(get != null) {
if (get != null) {
framework = get.getParameters().get(0);
if (framework instanceof PathParameter) {
PathParameter param = (PathParameter) framework;
Expand All @@ -72,8 +73,6 @@ public Swagger configure(Swagger swagger) {
}
}

return swagger.info(getInfo())
.host(getHost())
.basePath("/api");
return swagger.info(getInfo()).host(getHost()).basePath("/api");
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator.exception;
Expand All @@ -25,8 +23,7 @@ public ApiException(int code, String msg) {
this.code = code;
}

public int getCode()
{
public int getCode() {
return code;
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator.exception;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator.exception;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator.model;
Expand All @@ -30,8 +28,7 @@ public class ApiResponse {
String type;
String message;

public ApiResponse() {
}
public ApiResponse() {}

public ApiResponse(int code, String message) {
this.code = code;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator.model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ public SecuritySchemeDefinition getSecurityDefinition() {
public void setSecurityDefinition(SecuritySchemeDefinition auth) {
this.auth = auth;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/**
* Copyright 2016 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* http:https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

package io.swagger.generator.model;
Expand All @@ -22,8 +20,7 @@ public class InputOption {
private Boolean required;
private String defaultValue;

public InputOption() {
}
public InputOption() {}

public InputOption(String name, String description, String defaultValue, Boolean required) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ public class ResponseCode {
private String code;
private String link;

public ResponseCode() {
}
public ResponseCode() {}

public ResponseCode(String code, String link) {
setCode(code);
setLink(link);
}

@ApiModelProperty(value = "File download code", example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a")
@ApiModelProperty(value = "File download code",
example = "d40029be-eda6-4d62-b1ef-d05e2e91a72a")
public String getCode() {
return code;
}
Expand All @@ -23,12 +23,14 @@ public void setCode(String code) {
this.code = code;
}

@ApiModelProperty(value = "URL for fetching the generated client", example = "http:https://generator.swagger.io:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
@ApiModelProperty(
value = "URL for fetching the generated client",
example = "http:https://generator.swagger.io:80/api/gen/download/d40029be-eda6-4d62-b1ef-d05e2e91a72a")
public String getLink() {
return link;
}

public void setLink(String link) {
this.link = link;
}
}
}
Loading

0 comments on commit 1e53557

Please sign in to comment.