Skip to content

Commit c8eef80

Browse files
committed
Make SessionId a string everywhere
Fixes #100
1 parent 0c02844 commit c8eef80

File tree

5 files changed

+150
-108
lines changed

5 files changed

+150
-108
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.2.3
2+
* ``Session#id`` is now a String #100
3+
* Updated dependencies
4+
15
# 1.2.2
26
* Updated dependencies
37
* Updated to OpenAPI Generator 7.4

openapi/openapi.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ components:
289289
type: object
290290
readOnly: true
291291
properties:
292+
id:
293+
type: string
292294
title:
293295
type: string
294296
description:
@@ -325,6 +327,7 @@ components:
325327
$ref: '#/components/schemas/Status'
326328
nullable: true
327329
required:
330+
- id
328331
- categoryItems
329332
- endsAt
330333
- isPlenumSession
@@ -339,9 +342,6 @@ components:
339342
- type: object
340343
readOnly: true
341344
properties:
342-
id:
343-
type: string
344-
format: integer # Sessions Endpoint contains only numeric IDs
345345
room:
346346
type: string
347347
nullable: true
@@ -358,7 +358,6 @@ components:
358358
items:
359359
$ref: '#/components/schemas/CategorySession'
360360
required:
361-
- id
362361
- questionAnswers
363362
- speakers
364363
- categories
@@ -368,8 +367,6 @@ components:
368367
- type: object
369368
readOnly: true
370369
properties:
371-
id:
372-
type: string # All Endpoint contains numeric IDs mixed with UUIDs
373370
speakers:
374371
type: array
375372
items:
@@ -379,9 +376,19 @@ components:
379376
items:
380377
$ref: '#/components/schemas/QuestionAnswer' # All Endpoint
381378
required:
382-
- id
383379
- questionAnswers
384380
- speakers
381+
SessionMinimal:
382+
type: object
383+
readOnly: true
384+
properties:
385+
id:
386+
type: integer
387+
name:
388+
type: string
389+
required:
390+
- id
391+
- name
385392
SessionGroup:
386393
type: object
387394
readOnly: true
@@ -396,17 +403,6 @@ components:
396403
$ref: '#/components/schemas/Session'
397404
isDefault:
398405
type: boolean
399-
SessionMinimal:
400-
type: object
401-
readOnly: true
402-
properties:
403-
id:
404-
type: integer
405-
name:
406-
type: string
407-
required:
408-
- id
409-
- name
410406
BaseSpeakerEssential:
411407
type: object
412408
readOnly: true

sessionize-java-client/src/generated/java/software/xdev/sessionize/model/BaseSession.java

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* BaseSession
4141
*/
4242
@JsonPropertyOrder({
43+
BaseSession.JSON_PROPERTY_ID,
4344
BaseSession.JSON_PROPERTY_TITLE,
4445
BaseSession.JSON_PROPERTY_DESCRIPTION,
4546
BaseSession.JSON_PROPERTY_STARTS_AT,
@@ -53,6 +54,9 @@
5354
BaseSession.JSON_PROPERTY_STATUS
5455
})
5556
public class BaseSession {
57+
public static final String JSON_PROPERTY_ID = "id";
58+
private String id;
59+
5660
public static final String JSON_PROPERTY_TITLE = "title";
5761
private String title;
5862

@@ -89,6 +93,32 @@ public class BaseSession {
8993
public BaseSession() {
9094
}
9195

96+
public BaseSession id(String id) {
97+
98+
this.id = id;
99+
return this;
100+
}
101+
102+
/**
103+
* Get id
104+
* @return id
105+
**/
106+
@jakarta.annotation.Nonnull
107+
@JsonProperty(JSON_PROPERTY_ID)
108+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
109+
110+
public String getId() {
111+
return id;
112+
}
113+
114+
115+
@JsonProperty(JSON_PROPERTY_ID)
116+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
117+
public void setId(String id) {
118+
this.id = id;
119+
}
120+
121+
92122
public BaseSession title(String title) {
93123

94124
this.title = title;
@@ -415,7 +445,8 @@ public boolean equals(Object o) {
415445
return false;
416446
}
417447
BaseSession baseSession = (BaseSession) o;
418-
return Objects.equals(this.title, baseSession.title) &&
448+
return Objects.equals(this.id, baseSession.id) &&
449+
Objects.equals(this.title, baseSession.title) &&
419450
equalsNullable(this.description, baseSession.description) &&
420451
Objects.equals(this.startsAt, baseSession.startsAt) &&
421452
Objects.equals(this.endsAt, baseSession.endsAt) &&
@@ -434,7 +465,7 @@ private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b)
434465

435466
@Override
436467
public int hashCode() {
437-
return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status);
468+
return Objects.hash(id, title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status);
438469
}
439470

440471
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -448,6 +479,7 @@ private static <T> int hashCodeNullable(JsonNullable<T> a) {
448479
public String toString() {
449480
StringBuilder sb = new StringBuilder();
450481
sb.append("class BaseSession {\n");
482+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
451483
sb.append(" title: ").append(toIndentedString(title)).append("\n");
452484
sb.append(" description: ").append(toIndentedString(description)).append("\n");
453485
sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n");
@@ -506,6 +538,16 @@ public String toUrlQueryString(String prefix) {
506538

507539
StringJoiner joiner = new StringJoiner("&");
508540

541+
// add `id` to the URL query string
542+
if (getId() != null) {
543+
try {
544+
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
545+
} catch (UnsupportedEncodingException e) {
546+
// Should never happen, UTF-8 is always supported
547+
throw new RuntimeException(e);
548+
}
549+
}
550+
509551
// add `title` to the URL query string
510552
if (getTitle() != null) {
511553
try {

sessionize-java-client/src/generated/java/software/xdev/sessionize/model/Session.java

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* Session
4444
*/
4545
@JsonPropertyOrder({
46+
Session.JSON_PROPERTY_ID,
4647
Session.JSON_PROPERTY_TITLE,
4748
Session.JSON_PROPERTY_DESCRIPTION,
4849
Session.JSON_PROPERTY_STARTS_AT,
@@ -54,13 +55,15 @@
5455
Session.JSON_PROPERTY_LIVE_URL,
5556
Session.JSON_PROPERTY_RECORDING_URL,
5657
Session.JSON_PROPERTY_STATUS,
57-
Session.JSON_PROPERTY_ID,
5858
Session.JSON_PROPERTY_ROOM,
5959
Session.JSON_PROPERTY_SPEAKERS,
6060
Session.JSON_PROPERTY_QUESTION_ANSWERS,
6161
Session.JSON_PROPERTY_CATEGORIES
6262
})
6363
public class Session {
64+
public static final String JSON_PROPERTY_ID = "id";
65+
private String id;
66+
6467
public static final String JSON_PROPERTY_TITLE = "title";
6568
private String title;
6669

@@ -94,9 +97,6 @@ public class Session {
9497
public static final String JSON_PROPERTY_STATUS = "status";
9598
private Status status;
9699

97-
public static final String JSON_PROPERTY_ID = "id";
98-
private Integer id;
99-
100100
public static final String JSON_PROPERTY_ROOM = "room";
101101
private JsonNullable<String> room = JsonNullable.<String>undefined();
102102

@@ -112,6 +112,32 @@ public class Session {
112112
public Session() {
113113
}
114114

115+
public Session id(String id) {
116+
117+
this.id = id;
118+
return this;
119+
}
120+
121+
/**
122+
* Get id
123+
* @return id
124+
**/
125+
@jakarta.annotation.Nonnull
126+
@JsonProperty(JSON_PROPERTY_ID)
127+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
128+
129+
public String getId() {
130+
return id;
131+
}
132+
133+
134+
@JsonProperty(JSON_PROPERTY_ID)
135+
@JsonInclude(value = JsonInclude.Include.ALWAYS)
136+
public void setId(String id) {
137+
this.id = id;
138+
}
139+
140+
115141
public Session title(String title) {
116142

117143
this.title = title;
@@ -430,32 +456,6 @@ public void setStatus(Status status) {
430456
}
431457

432458

433-
public Session id(Integer id) {
434-
435-
this.id = id;
436-
return this;
437-
}
438-
439-
/**
440-
* Get id
441-
* @return id
442-
**/
443-
@jakarta.annotation.Nonnull
444-
@JsonProperty(JSON_PROPERTY_ID)
445-
@JsonInclude(value = JsonInclude.Include.ALWAYS)
446-
447-
public Integer getId() {
448-
return id;
449-
}
450-
451-
452-
@JsonProperty(JSON_PROPERTY_ID)
453-
@JsonInclude(value = JsonInclude.Include.ALWAYS)
454-
public void setId(Integer id) {
455-
this.id = id;
456-
}
457-
458-
459459
public Session room(String room) {
460460
this.room = JsonNullable.<String>of(room);
461461

@@ -600,7 +600,8 @@ public boolean equals(Object o) {
600600
return false;
601601
}
602602
Session session = (Session) o;
603-
return Objects.equals(this.title, session.title) &&
603+
return Objects.equals(this.id, session.id) &&
604+
Objects.equals(this.title, session.title) &&
604605
equalsNullable(this.description, session.description) &&
605606
Objects.equals(this.startsAt, session.startsAt) &&
606607
Objects.equals(this.endsAt, session.endsAt) &&
@@ -611,7 +612,6 @@ public boolean equals(Object o) {
611612
equalsNullable(this.liveUrl, session.liveUrl) &&
612613
equalsNullable(this.recordingUrl, session.recordingUrl) &&
613614
Objects.equals(this.status, session.status) &&
614-
Objects.equals(this.id, session.id) &&
615615
equalsNullable(this.room, session.room) &&
616616
Objects.equals(this.speakers, session.speakers) &&
617617
Objects.equals(this.questionAnswers, session.questionAnswers) &&
@@ -624,7 +624,7 @@ private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b)
624624

625625
@Override
626626
public int hashCode() {
627-
return Objects.hash(title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status, id, hashCodeNullable(room), speakers, questionAnswers, categories);
627+
return Objects.hash(id, title, hashCodeNullable(description), startsAt, endsAt, isServiceSession, isPlenumSession, categoryItems, roomId, hashCodeNullable(liveUrl), hashCodeNullable(recordingUrl), status, hashCodeNullable(room), speakers, questionAnswers, categories);
628628
}
629629

630630
private static <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -638,6 +638,7 @@ private static <T> int hashCodeNullable(JsonNullable<T> a) {
638638
public String toString() {
639639
StringBuilder sb = new StringBuilder();
640640
sb.append("class Session {\n");
641+
sb.append(" id: ").append(toIndentedString(id)).append("\n");
641642
sb.append(" title: ").append(toIndentedString(title)).append("\n");
642643
sb.append(" description: ").append(toIndentedString(description)).append("\n");
643644
sb.append(" startsAt: ").append(toIndentedString(startsAt)).append("\n");
@@ -649,7 +650,6 @@ public String toString() {
649650
sb.append(" liveUrl: ").append(toIndentedString(liveUrl)).append("\n");
650651
sb.append(" recordingUrl: ").append(toIndentedString(recordingUrl)).append("\n");
651652
sb.append(" status: ").append(toIndentedString(status)).append("\n");
652-
sb.append(" id: ").append(toIndentedString(id)).append("\n");
653653
sb.append(" room: ").append(toIndentedString(room)).append("\n");
654654
sb.append(" speakers: ").append(toIndentedString(speakers)).append("\n");
655655
sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).append("\n");
@@ -701,6 +701,16 @@ public String toUrlQueryString(String prefix) {
701701

702702
StringJoiner joiner = new StringJoiner("&");
703703

704+
// add `id` to the URL query string
705+
if (getId() != null) {
706+
try {
707+
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
708+
} catch (UnsupportedEncodingException e) {
709+
// Should never happen, UTF-8 is always supported
710+
throw new RuntimeException(e);
711+
}
712+
}
713+
704714
// add `title` to the URL query string
705715
if (getTitle() != null) {
706716
try {
@@ -815,16 +825,6 @@ public String toUrlQueryString(String prefix) {
815825
}
816826
}
817827

818-
// add `id` to the URL query string
819-
if (getId() != null) {
820-
try {
821-
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
822-
} catch (UnsupportedEncodingException e) {
823-
// Should never happen, UTF-8 is always supported
824-
throw new RuntimeException(e);
825-
}
826-
}
827-
828828
// add `room` to the URL query string
829829
if (getRoom() != null) {
830830
try {

0 commit comments

Comments
 (0)