Commit 2144cf7b authored by Abhishek Kumar (SLB)'s avatar Abhishek Kumar (SLB) Committed by Chad Leong
Browse files

Merge branch 'Bug-9334' into 'master'

Enable the Published mode for System schema

Closes #75

See merge request !306

(cherry picked from commit 8aad7f4b)

e393015d Merge branch '75-M9-DDSC-content' into 'master'
e8d90404 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
14440284 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
ceea06f9 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
c7523da6 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
3086ccf1 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
ec25c1a1 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
e9395319 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
d47c9085 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
3f994fb5 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
253e3b99 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
3c705f52 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
fee0bb86 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
19de5d4c Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
eaf83b27 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
d7e715ba Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
495b31a9 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
791ec366 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
d15fb613 enable the Published mode for System schema
6f2bfc41 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
e9ee9a1c Merge branch 'master' into Bug-9334
8365106b Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
3a9c1233 new ITs for service
8101b086 Modify IT
39eb8778 new ITs for service
37eb372b new ITs for service
fe2cdf0f new ITs for service
705aa9c4 new ITs for service
857a7cb4 new ITs for service
a1a41e18 new ITs for service
c1e6d262 Rollback
9aca070d Merge remote-tracking branch 'origin/master' into Bug-9334
a1f5f9c1 Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
83902f67 Rollback
5328dc1a Merge branch 'master' of https://community.opengroup.org/osdu/platform/system/schema-service.git
641465d0 Merge branch 'master' into Bug-9334
b1e78d55 Merge branch 'master' into Bug-9334
f243d715 Merge branch 'Bug-9334' of...
75eaa2c6 changed descripytion
79bd4927 changed description
fe388d5b change api spec
51734192 Fossa update
parent abb96ba1
Pipeline #117040 failed with stages
in 3 minutes and 32 seconds
This diff is collapsed.
......@@ -17,12 +17,10 @@ paths:
tags:
- schemas/system
summary: Creates/Updates a schema in development status
description: Creates a new schema or updates an already existing schema with status `DEVELOPMENT` in the schema repository. If a user tries to create/update a schema with status other then `DEVELOPMENT`, API will throw an exception. Any
schema instance with the same schemaIdentity is replaced (in contrast to
the immutability of `PUBLISHED` or `OBSOLETE` schemas). A schema state can also be changed from `DEVELOPMENT` to `PUBLISHED` or `OBSOLETE` while updating schema content or by providing the same schema content. **Note:** The
schema may refer to other schema definitions in `DEVELOPMENT` state. If
those schemas are updated themselves, it is the developer's
responsibility to PUT the dependent schemas again to update the schemas. Scope for a schema will be SHARED for all the schemas created using this API. Service principal
description: Creates a new schema or updates an already existing schema with status `DEVELOPMENT` in the schema repository. If a user tries to create a schema with status other then `DEVELOPMENT`, API will not throw an exception. The update
of schema without `DEVELOPMENT` status would cause error.Any schema instance with the same schemaIdentity is replaced. A schema state can also be changed from `DEVELOPMENT` to `PUBLISHED` or `OBSOLETE` while updating schema content or by providing the same schema content. **Note:** The
schema may refer to other schema definitions in `DEVELOPMENT` state. If those schemas are updated themselves, it is the developer's
responsibility to PUT the dependent schemas again to update the schema. Scope for a schema will be SHARED for all the schemas created using this API. Service principal
authorization is required to call thi API.
operationId: Update System Schema
requestBody:
......
......@@ -210,7 +210,7 @@ public class SchemaService implements ISchemaService {
schemaInfo = this.getSchemaInfo(createdSchemaId, isSystemSchema);
} catch (NotFoundException e) {
log.error(SchemaConstants.INVALID_SCHEMA_UPDATE);
if (!SchemaStatus.DEVELOPMENT.equals(schemaRequest.getSchemaInfo().getStatus()))
if (!SchemaStatus.DEVELOPMENT.equals(schemaRequest.getSchemaInfo().getStatus()) && !isSystemSchema)
throw new BadRequestException(SchemaConstants.SCHEMA_PUT_CREATE_EXCEPTION);
throw new NoSchemaFoundException(SchemaConstants.INVALID_SCHEMA_UPDATE);
}
......
......@@ -32,14 +32,14 @@ Feature: To verify functionality of PUT schema Service
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "200" | "200" | "/output_payloads/UpdatedResolvedSchema.json" | "/input_payloads/putUpdatedSchema_positiveScenario.json" |
@SchemaService
Scenario Outline: Verify that System schema PUT API throws error if put request tries to create new record without development status
Scenario Outline: Verify that System schema PUT API is success if put request tries to create new record without development status
Given I hit system schema PUT API with <InputPayload> and mark schema as <status> for next major version
Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>
Then service should respond back with <ReponseStatusCode> and <ResponseMessage>
Examples:
| InputPayload | ReponseStatusCode | ResponseMessage | status |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "400" | "/output_payloads/SchemaPut_InvalidStatusMessage.json" | "OBSOLETE" |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "400" | "/output_payloads/SchemaPut_InvalidStatusMessage.json" | "PUBLISHED" |
| InputPayload | ReponseStatusCode | ResponseMessage | status |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "201" | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "OBSOLETE" |
| "/input_payloads/postInPrivateScope_positiveScenario.json" | "201" | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "PUBLISHED" |
@SchemaService
Scenario Outline: Verify that System schema PUT API throws error if modification in schemaInfo is requested
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment