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
20 changes: 20 additions & 0 deletions bottlenote-mono/src/main/resources/openapi/curation/program.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@
"x-field-style": "plain-number",
"x-display-name": "참가비"
},
"is_tbc": {
"type": "boolean",
"description": "행사 참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.",
"example": false,
"x-field-style": "none",
"x-display-name": "참가비 미정 여부"
},
"officialUrl": {
"type": "string",
"description": "행사 공식 페이지 URL",
Expand Down Expand Up @@ -492,6 +499,19 @@
"description": "피드에서 행사 참가비를 표시하기 위해 포함한다."
}
},
"is_tbc": {
"type": "boolean",
"description": "행사 참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.",
"example": false,
"x-field-style": "none",
"x-display-name": "참가비 미정 여부",
"x-feed": {
"enabled": true,
"role": "price-tbc",
"order": 41,
"description": "피드에서 행사 참가비 미정 여부를 구분하기 위해 포함한다."
}
},
"officialUrl": {
"type": "string",
"description": "행사 공식 페이지 URL",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@
"x-field-style": "plain-number",
"x-display-name": "참가비(1인당)"
},
"is_tbc": {
"type": "boolean",
"description": "참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.",
"example": false,
"x-field-style": "none",
"x-display-name": "참가비 미정 여부"
},
"capacity": {
"type": "integer",
"minimum": 0,
Expand Down Expand Up @@ -382,6 +389,19 @@
"description": "피드에서 참가비 정보를 표시하기 위해 포함한다."
}
},
"is_tbc": {
"type": "boolean",
"description": "참가비 미정 여부. false이면 entryFee의 0은 무료를 뜻한다.",
"example": false,
"x-field-style": "none",
"x-display-name": "참가비 미정 여부",
"x-feed": {
"enabled": true,
"role": "price-tbc",
"order": 51,
"description": "피드에서 참가비 미정 여부를 구분하기 위해 포함한다."
}
},
"capacity": {
"type": "integer",
"description": "총 모집 인원수",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,27 @@ void extractFeedPayload_exposesPlaceNameButNotKakaoPlaceId() throws IOException
assertThat(feedPayload.has("kakaoPlaceId")).isFalse();
}

@Test
@DisplayName("가격 스펙은 무료와 미정 구분을 위한 is_tbc 값을 요청과 피드에 선언한다")
void priceSpecs_declareOptionalIsTbcForRequestResponseAndFeed() throws IOException {
for (String resource : List.of(TASTING, PROGRAM)) {
JsonNode request = OBJECT_MAPPER.valueToTree(schema(resource, "Request"));
JsonNode response = OBJECT_MAPPER.valueToTree(schema(resource, "Response"));

assertThat(request.path("properties").path("is_tbc").path("type").asText())
.isEqualTo("boolean");
assertThat(request.path("required").toString()).doesNotContain("is_tbc");
assertThat(response.path("properties").path("is_tbc").path("type").asText())
.isEqualTo("boolean");
assertThat(response.path("required").toString()).doesNotContain("is_tbc");
assertThat(
response.path("properties").path("is_tbc").path("x-feed").path("enabled").asBoolean())
.isTrue();
assertThat(response.path("properties").path("is_tbc").path("x-feed").path("role").asText())
.isEqualTo("price-tbc");
}
}

@Test
@DisplayName("네 스펙 문서 모두 스펙 자체 검증을 통과한다")
void validateSpec_allSchemas_areValid() throws IOException {
Expand Down
Loading