Skip to content

Commit e4eb366

Browse files
committed
review code formatting
1 parent a0702bf commit e4eb366

File tree

104 files changed

+994
-915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+994
-915
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
# Spring-boot with OpenAPI Demo applications.
44

55
## [Demo Spring Boot 2 Web MVC with OpenAPI 3](http://158.101.191.70:8081/).
6+
67
## [Demo Spring Boot 2 WebFlux with OpenAPI 3](http://158.101.191.70:8082/).
8+
79
## [Demo Spring Boot 1 Web MVC with OpenAPI 3](http://158.101.191.70:8083/).
10+
811
## [Demo Spring Boot 2 WebFlux with Functional endpoints OpenAPI 3](http://158.101.191.70:8084/swagger-ui.html).
9-
## [Demo Spring Boot 2 and Spring Hateoas with OpenAPI 3](http://158.101.191.70:8085/swagger-ui.html).
1012

13+
## [Demo Spring Boot 2 and Spring Hateoas with OpenAPI 3](http://158.101.191.70:8085/swagger-ui.html).
1114

1215
![Branching](https://springdoc.org/images/pets.png)
1316

14-
1517
# **Thank you for the support**
1618

17-
* Thanks a lot [JetBrains](https://www.jetbrains.com/?from=springdoc-openapi) for supporting springdoc-openapi project.
19+
* Thanks a lot [JetBrains](https://www.jetbrains.com/?from=springdoc-openapi) for
20+
supporting springdoc-openapi project.
1821

1922
![JenBrains logo](https://springdoc.org/images/jetbrains.svg)
2023

SUPPORT.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
## Where to get help
22

3-
If you think you've found a bug in The Architect Theme, please [check the existing issues](https://github.com/pages-themes/architect/issues), and if no one has reported the problem, [open a new issue](https://github.com/pages-themes/architect/issues/new).
3+
If you think you've found a bug in The Architect Theme,
4+
please [check the existing issues](https://github.com/pages-themes/architect/issues), and
5+
if no one has reported the
6+
problem, [open a new issue](https://github.com/pages-themes/architect/issues/new).
47

5-
If you have a general question about the theme, how to implement it, or how to customize it for your site you have two options:
8+
If you have a general question about the theme, how to implement it, or how to customize
9+
it for your site you have two options:
610

7-
1. [Contact GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages%20theme%20pages-themes/architect), or
11+
1. [Contact GitHub Support](https://github.com/contact?form%5Bsubject%5D=GitHub%20Pages%20theme%20pages-themes/architect)
12+
, or
813

9-
2. Ask your question of the Jekyll community on [talk.jekyllrb.com](https://talk.jekyllrb.com/)
14+
2. Ask your question of the Jekyll community
15+
on [talk.jekyllrb.com](https://talk.jekyllrb.com/)
1016

1117
Notes:
18+
1219
- https://hub.docker.com/repository/docker/springdocdemos/spring-cloud-function-webmvc/tags?page=1&ordering=last_updated
1320
- https://github.com/springdoc/springdoc-openapi-demos/wiki/springdoc-openapi-2.x-migration-guide
1421
- https://springdoc.org/v2/demos.html
1522
- https://s01.oss.sonatype.org/content/repositories/snapshots/org/springdoc/
16-
- docker run --rm -p 8080:8081 springdocdemos/springdoc-openapi-spring-boot-2-webmvc:3.1.7-SNAPSHOT
23+
- docker run --rm -p 8080:8081 springdocdemos/springdoc-openapi-spring-boot-2-webmvc:
24+
3.1.7-SNAPSHOT

demo-book-service/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
### Relevant Articles:
2+
23
- [Documenting a Spring REST API Using OpenAPI 3.0](https://www.baeldung.com/spring-rest-openapi-documentation)
34

demo-book-service/pom.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
35
<modelVersion>4.0.0</modelVersion>
46
<parent>
57
<groupId>org.springdoc</groupId>

demo-microservices/config-service/pom.xml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<modelVersion>4.0.0</modelVersion>
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
35
<artifactId>config-service</artifactId>
46
<parent>
57
<groupId>org.springdoc</groupId>
@@ -13,5 +15,5 @@
1315
<artifactId>spring-cloud-config-server</artifactId>
1416
</dependency>
1517
</dependencies>
16-
18+
1719
</project>

demo-microservices/config-service/src/main/resources/config/department-service.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ eureka:
88
preferIpAddress: true
99

1010
logging:
11-
pattern:
11+
pattern:
1212
console: "%d{yyyy-MM-dd HH:mm:ss} ${LOG_LEVEL_PATTERN:-%5p} %m%n"

demo-microservices/config-service/src/main/resources/config/employee-service.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ eureka:
88
preferIpAddress: true
99

1010
logging:
11-
pattern:
11+
pattern:
1212
console: "%d{yyyy-MM-dd HH:mm:ss} ${LOG_LEVEL_PATTERN:-%5p} %m%n"

demo-microservices/config-service/src/main/resources/config/organization-service.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ eureka:
99
preferIpAddress: true
1010

1111
logging:
12-
pattern:
12+
pattern:
1313
console: "%d{yyyy-MM-dd HH:mm:ss} ${LOG_LEVEL_PATTERN:-%5p} %m%n"

demo-microservices/department-service/pom.xml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2-
<modelVersion>4.0.0</modelVersion>
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
35
<parent>
46
<groupId>org.springdoc</groupId>
57
<artifactId>demo-microservices</artifactId>
@@ -37,5 +39,5 @@
3739
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
3840
</dependency>
3941
</dependencies>
40-
42+
4143
</project>

demo-microservices/department-service/src/main/java/org/springdoc/demo/services/department/DepartmentApplication.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@EnableDiscoveryClient
1616
@EnableFeignClients
1717
@OpenAPIDefinition(info =
18-
@Info(title = "Department API", version = "${springdoc.version}", description = "Documentation Department API v1.0")
18+
@Info(title = "Department API", version = "${springdoc.version}", description = "Documentation Department API v1.0")
1919
)
2020
public class DepartmentApplication {
2121

@@ -29,7 +29,7 @@ DepartmentRepository repository() {
2929
repository.add(new Department(1L, "Development"));
3030
repository.add(new Department(1L, "Operations"));
3131
repository.add(new Department(2L, "Development"));
32-
repository.add(new Department(2L, "Operations"));
32+
repository.add(new Department(2L, "Operations"));
3333
return repository;
3434
}
3535
}

demo-microservices/department-service/src/main/java/org/springdoc/demo/services/department/client/EmployeeClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ public interface EmployeeClient {
1313

1414
@GetMapping("/department/{departmentId}")
1515
List<Employee> findByDepartment(@PathVariable("departmentId") Long departmentId);
16-
16+
1717
}

demo-microservices/department-service/src/main/java/org/springdoc/demo/services/department/controller/DepartmentController.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
public class DepartmentController {
1919

2020
private static final Logger LOGGER = LoggerFactory.getLogger(DepartmentController.class);
21+
2122
private DepartmentRepository repository;
23+
2224
private EmployeeClient employeeClient;
2325

2426
public DepartmentController(DepartmentRepository repository, EmployeeClient employeeClient) {
@@ -31,31 +33,31 @@ public Department add(@RequestBody Department department) {
3133
LOGGER.info("Department add: {}", department);
3234
return repository.add(department);
3335
}
34-
36+
3537
@GetMapping("/{id}")
3638
public Department findById(@PathVariable("id") Long id) {
3739
LOGGER.info("Department find: id={}", id);
3840
return repository.findById(id);
3941
}
40-
42+
4143
@GetMapping("/")
4244
public List<Department> findAll() {
4345
LOGGER.info("Department find");
4446
return repository.findAll();
4547
}
46-
48+
4749
@GetMapping("/organization/{organizationId}")
4850
public List<Department> findByOrganization(@PathVariable("organizationId") Long organizationId) {
4951
LOGGER.info("Department find: organizationId={}", organizationId);
5052
return repository.findByOrganization(organizationId);
5153
}
52-
54+
5355
@GetMapping("/organization/{organizationId}/with-employees")
5456
public List<Department> findByOrganizationWithEmployees(@PathVariable("organizationId") Long organizationId) {
5557
LOGGER.info("Department find: organizationId={}", organizationId);
5658
List<Department> departments = repository.findByOrganization(organizationId);
5759
departments.forEach(d -> d.setEmployees(employeeClient.findByDepartment(d.getId())));
5860
return departments;
5961
}
60-
62+
6163
}

demo-microservices/department-service/src/main/java/org/springdoc/demo/services/department/model/Department.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
public class Department {
77

88
private Long id;
9+
910
private Long organizationId;
11+
1012
private String name;
13+
1114
private List<Employee> employees = new ArrayList<>();
1215

1316
public Department() {
14-
17+
1518
}
1619

1720
public Department(Long organizationId, String name) {

demo-microservices/department-service/src/main/java/org/springdoc/demo/services/department/model/Employee.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
public class Employee {
44

55
private Long id;
6+
67
private String name;
8+
79
private int age;
10+
811
private String position;
912

1013
public Employee() {
1114

1215
}
13-
16+
1417
public Employee(String name, int age, String position) {
1518
this.name = name;
1619
this.age = age;

demo-microservices/department-service/src/main/java/org/springdoc/demo/services/department/repository/DepartmentRepository.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
public class DepartmentRepository {
1111

1212
private List<Department> departments = new ArrayList<>();
13-
13+
1414
public Department add(Department department) {
15-
department.setId((long) (departments.size()+1));
15+
department.setId((long) (departments.size() + 1));
1616
departments.add(department);
1717
return department;
1818
}
19-
19+
2020
public Department findById(Long id) {
2121
Optional<Department> department = departments.stream().filter(a -> a.getId().equals(id)).findFirst();
2222
if (department.isPresent())
2323
return department.get();
2424
else
2525
return null;
2626
}
27-
27+
2828
public List<Department> findAll() {
2929
return departments;
3030
}
31-
31+
3232
public List<Department> findByOrganization(Long organizationId) {
3333
return departments.stream().filter(a -> a.getOrganizationId().equals(organizationId)).collect(Collectors.toList());
3434
}
35-
35+
3636
}

demo-microservices/discovery-service/pom.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24
<modelVersion>4.0.0</modelVersion>
35
<parent>
46
<groupId>org.springdoc</groupId>

demo-microservices/employee-service/pom.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xmlns="http://maven.apache.org/POM/4.0.0"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24
<modelVersion>4.0.0</modelVersion>
35
<parent>
46
<groupId>org.springdoc</groupId>

demo-microservices/employee-service/src/main/java/org/springdoc/demo/services/employee/EmployeeApplication.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@SpringBootApplication
1414
@EnableDiscoveryClient
1515
@OpenAPIDefinition(info =
16-
@Info(title = "Employee API", version = "${springdoc.version}", description = "Documentation Employee API v1.0")
16+
@Info(title = "Employee API", version = "${springdoc.version}", description = "Documentation Employee API v1.0")
1717
)
1818
public class EmployeeApplication {
1919

@@ -27,9 +27,9 @@ EmployeeRepository repository() {
2727
repository.add(new Employee(1L, 1L, "John Smith", 34, "Analyst"));
2828
repository.add(new Employee(1L, 1L, "Darren Hamilton", 37, "Manager"));
2929
repository.add(new Employee(1L, 1L, "Tom Scott", 26, "Developer"));
30-
repository.add(new Employee(1L, 2L, "Anna London", 39, "Analyst"));
30+
repository.add(new Employee(1L, 2L, "Anna London", 39, "Analyst"));
3131
repository.add(new Employee(1L, 2L, "Patrick Dempsey", 27, "Developer"));
32-
repository.add(new Employee(2L, 3L, "Kevin Price", 38, "Developer"));
32+
repository.add(new Employee(2L, 3L, "Kevin Price", 38, "Developer"));
3333
repository.add(new Employee(2L, 3L, "Ian Scott", 34, "Developer"));
3434
repository.add(new Employee(2L, 3L, "Andrew Campton", 30, "Manager"));
3535
repository.add(new Employee(2L, 4L, "Steve Franklin", 25, "Developer"));

demo-microservices/employee-service/src/main/java/org/springdoc/demo/services/employee/controller/EmployeeController.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
public class EmployeeController {
1818

1919
private static final Logger LOGGER = LoggerFactory.getLogger(EmployeeController.class);
20+
2021
private EmployeeRepository repository;
2122

2223
public EmployeeController(EmployeeRepository repository) {
@@ -28,29 +29,29 @@ public Employee add(@RequestBody Employee employee) {
2829
LOGGER.info("Employee add: {}", employee);
2930
return repository.add(employee);
3031
}
31-
32+
3233
@GetMapping("/{id}")
3334
public Employee findById(@PathVariable("id") Long id) {
3435
LOGGER.info("Employee find: id={}", id);
3536
return repository.findById(id);
3637
}
37-
38+
3839
@GetMapping("/")
3940
public List<Employee> findAll() {
4041
LOGGER.info("Employee find");
4142
return repository.findAll();
4243
}
43-
44+
4445
@GetMapping("/department/{departmentId}")
4546
public List<Employee> findByDepartment(@PathVariable("departmentId") Long departmentId) {
4647
LOGGER.info("Employee find: departmentId={}", departmentId);
4748
return repository.findByDepartment(departmentId);
4849
}
49-
50+
5051
@GetMapping("/organization/{organizationId}")
5152
public List<Employee> findByOrganization(@PathVariable("organizationId") Long organizationId) {
5253
LOGGER.info("Employee find: organizationId={}", organizationId);
5354
return repository.findByOrganization(organizationId);
5455
}
55-
56+
5657
}

demo-microservices/employee-service/src/main/java/org/springdoc/demo/services/employee/model/Employee.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,21 @@
33
public class Employee {
44

55
private Long id;
6+
67
private Long organizationId;
8+
79
private Long departmentId;
10+
811
private String name;
12+
913
private int age;
14+
1015
private String position;
1116

1217
public Employee() {
1318

1419
}
15-
20+
1621
public Employee(Long organizationId, Long departmentId, String name, int age, String position) {
1722
this.organizationId = organizationId;
1823
this.departmentId = departmentId;

0 commit comments

Comments
 (0)