Skip to content

Commit d1794cf

Browse files
committed
Adapted OAS to show response schema for all endpoints
1 parent 7ece737 commit d1794cf

File tree

7 files changed

+7
-223
lines changed

7 files changed

+7
-223
lines changed

src/main/java/org/lucoenergia/conluz/infrastructure/price/get/GetPriceByHourController.java

Lines changed: 1 addition & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -43,111 +43,7 @@ public GetPriceByHourController(GetPriceService getPriceService) {
4343
@ApiResponse(
4444
responseCode = "200",
4545
description = "Query executed successfully",
46-
content = @Content(
47-
mediaType = MediaType.APPLICATION_JSON_VALUE,
48-
examples = @ExampleObject(
49-
value = """
50-
[
51-
{
52-
"price": 114.1,
53-
"hour": "2023-10-25T00:00:00+02:00"
54-
},
55-
{
56-
"price": 98.37,
57-
"hour": "2023-10-25T01:00:00+02:00"
58-
},
59-
{
60-
"price": 70.75,
61-
"hour": "2023-10-25T02:00:00+02:00"
62-
},
63-
{
64-
"price": 64.75,
65-
"hour": "2023-10-25T03:00:00+02:00"
66-
},
67-
{
68-
"price": 62.65,
69-
"hour": "2023-10-25T04:00:00+02:00"
70-
},
71-
{
72-
"price": 61.42,
73-
"hour": "2023-10-25T05:00:00+02:00"
74-
},
75-
{
76-
"price": 45.59,
77-
"hour": "2023-10-25T06:00:00+02:00"
78-
},
79-
{
80-
"price": 59.75,
81-
"hour": "2023-10-25T07:00:00+02:00"
82-
},
83-
{
84-
"price": 65.1,
85-
"hour": "2023-10-25T08:00:00+02:00"
86-
},
87-
{
88-
"price": 88.59,
89-
"hour": "2023-10-25T09:00:00+02:00"
90-
},
91-
{
92-
"price": 104.25,
93-
"hour": "2023-10-25T10:00:00+02:00"
94-
},
95-
{
96-
"price": 95,
97-
"hour": "2023-10-25T11:00:00+02:00"
98-
},
99-
{
100-
"price": 70.75,
101-
"hour": "2023-10-25T12:00:00+02:00"
102-
},
103-
{
104-
"price": 62.65,
105-
"hour": "2023-10-25T13:00:00+02:00"
106-
},
107-
{
108-
"price": 45.48,
109-
"hour": "2023-10-25T14:00:00+02:00"
110-
},
111-
{
112-
"price": 35,
113-
"hour": "2023-10-25T15:00:00+02:00"
114-
},
115-
{
116-
"price": 20,
117-
"hour": "2023-10-25T16:00:00+02:00"
118-
},
119-
{
120-
"price": 17.45,
121-
"hour": "2023-10-25T17:00:00+02:00"
122-
},
123-
{
124-
"price": 37.77,
125-
"hour": "2023-10-25T18:00:00+02:00"
126-
},
127-
{
128-
"price": 64.75,
129-
"hour": "2023-10-25T19:00:00+02:00"
130-
},
131-
{
132-
"price": 85,
133-
"hour": "2023-10-25T20:00:00+02:00"
134-
},
135-
{
136-
"price": 97.56,
137-
"hour": "2023-10-25T21:00:00+02:00"
138-
},
139-
{
140-
"price": 109.68,
141-
"hour": "2023-10-25T22:00:00+02:00"
142-
},
143-
{
144-
"price": 105.97,
145-
"hour": "2023-10-25T23:00:00+02:00"
146-
}
147-
]
148-
"""
149-
)
150-
)
46+
useReturnTypeSchema = true
15147
)
15248
})
15349
@ForbiddenErrorResponse

src/main/java/org/lucoenergia/conluz/infrastructure/production/get/GetDailyProductionController.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ public GetDailyProductionController(GetProductionService getProductionService) {
4646
@ApiResponse(
4747
responseCode = "200",
4848
description = "Query executed successfully",
49-
content = @Content(
50-
mediaType = MediaType.APPLICATION_JSON_VALUE,
51-
examples = @ExampleObject(
52-
value = """
53-
54-
"""
55-
)
56-
)
49+
useReturnTypeSchema = true
5750
)
5851
})
5952
@ForbiddenErrorResponse

src/main/java/org/lucoenergia/conluz/infrastructure/production/get/GetHourlyProductionController.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ public GetHourlyProductionController(GetProductionService getProductionService)
4646
@ApiResponse(
4747
responseCode = "200",
4848
description = "Query executed successfully",
49-
content = @Content(
50-
mediaType = MediaType.APPLICATION_JSON_VALUE,
51-
examples = @ExampleObject(
52-
value = """
53-
54-
"""
55-
)
56-
)
49+
useReturnTypeSchema = true
5750
)
5851
})
5952
@ForbiddenErrorResponse

src/main/java/org/lucoenergia/conluz/infrastructure/production/get/GetInstantProductionController.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ public GetInstantProductionController(GetProductionService getProductionService)
4343
@ApiResponse(
4444
responseCode = "200",
4545
description = "Query executed successfully",
46-
content = @Content(
47-
mediaType = MediaType.APPLICATION_JSON_VALUE,
48-
examples = @ExampleObject(
49-
value = """
50-
51-
"""
52-
)
53-
)
46+
useReturnTypeSchema = true
5447
)
5548
})
5649
@ForbiddenErrorResponse

src/main/java/org/lucoenergia/conluz/infrastructure/production/get/GetMonthlyProductionController.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ public GetMonthlyProductionController(GetProductionService getProductionService)
4646
@ApiResponse(
4747
responseCode = "200",
4848
description = "Query executed successfully",
49-
content = @Content(
50-
mediaType = MediaType.APPLICATION_JSON_VALUE,
51-
examples = @ExampleObject(
52-
value = """
53-
54-
"""
55-
)
56-
)
49+
useReturnTypeSchema = true
5750
)
5851
})
5952
@ForbiddenErrorResponse

src/main/java/org/lucoenergia/conluz/infrastructure/production/get/GetYearlyProductionController.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ public GetYearlyProductionController(GetProductionService getProductionService)
4646
@ApiResponse(
4747
responseCode = "200",
4848
description = "Query executed successfully",
49-
content = @Content(
50-
mediaType = MediaType.APPLICATION_JSON_VALUE,
51-
examples = @ExampleObject(
52-
value = """
53-
54-
"""
55-
)
56-
)
49+
useReturnTypeSchema = true
5750
)
5851
})
5952
@ForbiddenErrorResponse

src/main/java/org/lucoenergia/conluz/infrastructure/production/plant/get/GetAllPlantsController.java

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -51,84 +51,7 @@ public GetAllPlantsController(GetPlantService service, PaginationRequestMapper p
5151
@ApiResponse(
5252
responseCode = "200",
5353
description = "Query executed successfully",
54-
content = @Content(
55-
mediaType = MediaType.APPLICATION_JSON_VALUE,
56-
examples = @ExampleObject(
57-
value = """
58-
{
59-
"items":[
60-
{
61-
"id":"785de77b-8c22-4d2f-9d12-f172113f9aa4",
62-
"code":"TS-239487",
63-
"user":{
64-
"id":"e7ab39cd-9250-40a9-b829-f11f65aae27d",
65-
"personalId":"rAtjrSXAU",
66-
"number":646650705,
67-
"fullName":"John Doe",
68-
"address":"Fake Street 123",
69-
"email":"[email protected]",
70-
"phoneNumber":"+34666333111",
71-
"enabled":true,
72-
"role":"PARTNER"
73-
},
74-
"name":"Solar plant 1",
75-
"address":"Fake Street 123",
76-
"description":"The first solar plant we installed",
77-
"inverterProvider": "Huawei",
78-
"totalPower":"60",
79-
"connectionDate":"2024/01/23"
80-
},
81-
{
82-
"id":"dee217f7-dd3e-4dc2-9be9-9cebca17a3ae",
83-
"code":"TS-3240598",
84-
"user":{
85-
"id":"e7ab39cd-9250-40a9-b829-f11f65aae27d",
86-
"personalId":"rAtjrSXAU",
87-
"number":646650705,
88-
"fullName":"John Doe",
89-
"address":"Fake Street 123",
90-
"email":"[email protected]",
91-
"phoneNumber":"+34666333111",
92-
"enabled":true,
93-
"role":"PARTNER"
94-
},
95-
"name":"Solar plant 2",
96-
"address":"Fake Street 456",
97-
"description":"The second solar plant we installed",
98-
"inverterProvider": "Huawei",
99-
"totalPower":"30",
100-
"connectionDate":"2024/03/23"
101-
},
102-
{
103-
"id":"f6331a5a-6f11-4439-90f2-e7ecee854c40",
104-
"code":"TE-234987",
105-
"user":{
106-
"id":"e7ab39cd-9250-40a9-b829-f11f65aae27d",
107-
"personalId":"rAtjrSXAU",
108-
"number":646650705,
109-
"fullName":"John Doe",
110-
"address":"Fake Street 123",
111-
"email":"[email protected]",
112-
"phoneNumber":"+34666333111",
113-
"enabled":true,
114-
"role":"PARTNER"
115-
},
116-
"name":"Solar plant 3",
117-
"address":"Fake Street 789",
118-
"description":"The last solar plant we installed",
119-
"inverterProvider": "Huawei",
120-
"totalPower":"40",
121-
"connectionDate":"2024/05/23"
122-
}
123-
],
124-
"size":10,
125-
"totalElements":3,
126-
"totalPages":1,
127-
"number":0
128-
}
129-
"""
130-
)
131-
)
54+
useReturnTypeSchema = true
13255
)
13356
})
13457
@ForbiddenErrorResponse

0 commit comments

Comments
 (0)