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
38 changes: 36 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,45 @@ tasks.register("openApiGenerateProjectInfoServicesClient", GenerateTask) {
]
}

tasks.register("openApiGenerateFeedbackApiClient", GenerateTask) {
generatorName = "java"
outputDir = "$projectDir/target/generated-sources/openapi-client-feedback-api"
inputSpec = "$projectDir/openapi/openapi-feedback-api-v0.0.1.yaml"
library = "resttemplate"

globalProperties = [
generateAliasAsModel: "true",
apiDocs : "true",
modelDocs : "true",
apiTests : "false",
modelTests : "false"
]

additionalProperties = [
serializableModel : "true",
useJakartaEe : "true",
java8 : "true",
groupId : "feedback",
artifactId : "feedback-api-v0-client",
artifactVersion : "0.0.0-SNAPSHOT",
invokerPackage : "org.opendevstack.component_catalog.client.feedback_api.v0_0_1",
apiPackage : "org.opendevstack.component_catalog.client.feedback_api.v0_0_1.api",
modelPackage : "org.opendevstack.component_catalog.client.feedback_api.v0_0_1.model",
additionalModelTypeAnnotations : "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)",
generateBuilders : "true",
generateClientAsBean : "true",
useSingleRequestParameter : "true",
hideGenerationTimestamp : "true"
]
}

// Ensure code generation runs before Java compilation
tasks.named("compileJava") {
dependsOn(
tasks.named("openApiGenerate"),
tasks.named("openApiGenerateBitbucketClient"),
tasks.named("openApiGenerateProjectInfoServicesClient")
tasks.named("openApiGenerateProjectInfoServicesClient"),
tasks.named("openApiGenerateFeedbackApiClient")
)
}

Expand All @@ -264,7 +297,8 @@ sourceSets {
"src/main/java",
"$projectDir/target/generated-sources/openapi-server-component_catalog/src/main/java",
"$projectDir/target/generated-sources/openapi-client-bitbucket/src/main/java",
"$projectDir/target/generated-sources/openapi-client-projects-info-service/src/main/java"
"$projectDir/target/generated-sources/openapi-client-projects-info-service/src/main/java",
"$projectDir/target/generated-sources/openapi-client-feedback-api/src/main/java"
]
}
resources {
Expand Down
105 changes: 105 additions & 0 deletions openapi/openapi-component_catalog-v1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ tags:
description: Provisioning notifications from AWX/Provisioner
- name: CacheAdministration
description: Internal cache administration operations.
- name: FeedbackSubmissions
description: Feedback submissions operations.
paths:
/project/components:
get:
Expand Down Expand Up @@ -1167,6 +1169,50 @@ paths:
"500":
description: Server error.

/feedback/submissions:
post:
tags:
- FeedbackSubmissions
summary: Register a feedback submission
operationId: registerFeedbackSubmission
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackSubmissionRequest'
responses:
'201':
description: Feedback submission created
content:
application/json:
schema:
$ref: '#/components/schemas/FeedbackSubmission'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/RestErrorMessage'
'401':
description: Invalid client token or unregistered client application
content:
application/json:
schema:
$ref: '#/components/schemas/RestErrorMessage'
'403':
description: Insufficient permissions
content:
application/json:
schema:
$ref: '#/components/schemas/RestErrorMessage'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/RestErrorMessage'

components:
securitySchemes:
bearerAuth:
Expand Down Expand Up @@ -1662,6 +1708,65 @@ components:
type: string
required:
- message
FeedbackSubmissionRequest:
type: object
required:
- questions
- answers
- submitter
properties:
projectKey:
type: string
minLength: 1
description: Optional project key; omit to submit feedback without a project association.
submitter:
type: string
format: email
minLength: 1
description: Email address of the person submitting feedback.
questions:
type: array
items:
type: object
additionalProperties: true
description: Question definitions shown to the submitter.
answers:
type: object
additionalProperties: true
description: Answers and possible follow-ups submitted.
FeedbackSubmission:
type: object
required:
- clientAppRegistrationId
- clientName
- submittedAt
- questions
- answers
properties:
clientAppRegistrationId:
type: string
format: uuid
description: Azure application registration identifier from the caller token.
clientName:
type: string
projectKey:
type: string
nullable: true
description: Project key, null when no project was supplied.
submitter:
type: string
description: Optional submitter identity.
submittedAt:
type: string
format: date-time
questions:
type: array
items:
type: object
additionalProperties: true
answers:
type: object
additionalProperties: true
ValidationResult:
type: object
properties:
Expand Down
Loading
Loading