Skip to content
Snippets Groups Projects
Commit e97fd32f authored by Shane Hutchins's avatar Shane Hutchins
Browse files

pages implementation and doc update

parent 308d1ff6
No related branches found
No related tags found
1 merge request!653pages implementation and doc update
Pipeline #251534 failed
......@@ -91,6 +91,7 @@ include:
- local: "/devops/aws/bootstrap.yaml"
- local: "/devops/ibm/bootstrap.yaml"
- local: "/publish.yml"
.maven:
image: maven:3.9.3-eclipse-temurin-17
......
## Documentation
Official documentation [https://osdu.pages.opengroup.org/platform/system/schema-service/](https://osdu.pages.opengroup.org/platform/system/schema-service/)
## Running the schema service locally
The Schema Service is a Maven multi-module project with each cloud implemention placed in its submodule. To build or run Schema Service locally, follow the below steps :
### 1. Google Cloud deployment
## 1. Google Cloud deployment
Instructions for running the Google Cloud implementation in the cloud can be found [here](./provider/schema-gc/README.md).
### 2. Azure deployment
## 2. Azure deployment
Instructions for running the Azure implementation in the cloud can be found [here](https://community.opengroup.org/osdu/platform/system/schema-service/-/blob/master/provider/schema-azure/README.md).
......
# API
## Open API 3.0 - Swagger
- Swagger UI : https://host/context-path/swagger (will redirect to https://host/context-path/swagger-ui/index.html)
- api-docs ([JSON](https://community.opengroup.org/osdu/platform/system/schema-service/-/blob/master/docs/api/schema_openapi.yaml)
) : https://host/context-path/api-docs
- api-docs (YAML) : https://host/context-path/api-docs.yaml
All the Swagger and OpenAPI related common properties are managed here [swagger.properties](https://community.opengroup.org/osdu/platform/system/schema-service/-/blob/master/schema-core/src/main/resources/swagger.properties)
## Version info endpoint
For deployment available public `/info` endpoint, which provides build and git related information.
#### Example response:
```json
{
"groupId": "org.opengroup.osdu",
"artifactId": "storage-gc",
"version": "0.10.0-SNAPSHOT",
"buildTime": "2021-07-09T14:29:51.584Z",
"branch": "feature/GONRG-2681_Build_info",
"commitId": "7777",
"commitMessage": "Added copyright to version info properties file",
"connectedOuterServices": [
{
"name": "elasticSearch",
"version":"..."
},
{
"name": "postgresSql",
"version":"..."
},
{
"name": "redis",
"version":"..."
}
]
}
```
This endpoint takes information from files, generated by `spring-boot-maven-plugin`,
`git-commit-id-plugin` plugins. Need to specify paths for generated files to matching
properties:
- `version.info.buildPropertiesPath`
- `version.info.gitPropertiesPath`
\ No newline at end of file
File moved
# Schema Service
- [Introduction](#introduction)
- [Concepts](#concepts)
- [How to use this service?](#using_this_service)
- [Current limitation](#limitation)
- [Schema Validation](#schema-validation)
- [Version info endpoint](#version-info-endpoint)
## Introduction <a name="introduction"></a>
## Introduction
Schema Service enables a centralized governance and management of schema in the Data Ecosystem. It offers an implementation of the schema standard.
Schema Service provides all necessary APIs to Fetch, create, update and mark a schema obsolete.
## Concepts <a name="concepts"></a>
## Concepts
* Schema - A data model definition. Schema Service allows data models to be defined in rich JSON objects (as per JSON schema specifications JSON Schema [draft #07](https://json-schema.org/understanding-json-schema/index.html)).
* Schema Resolution - Schema definitions could include references to other schema definitions or fragments. During Schema creation, Schema Service resolves all the referred schema fragments and creates a completely resolved schema. A sample entity-relationship diagram below demonstrates the associations between various domain entities and how schema fragment references can be helpful in defining models for these entities.
![](drilling_e_r.png)
......@@ -38,7 +30,7 @@ Schema Service provides all necessary APIs to Fetch, create, update and mark a s
## How to use this service? <a name="using_this_service"></a>
## How to use this service?
The Schema Service promotes re-use and composition via the JSON schema draft 07 features. Typically one would start
with the registration of reusable schema fragments or schema elements, which are used e.g. by API specifications or
......@@ -247,12 +239,13 @@ The following parameters are required to create a schema:
| schema | Schema definition | JSON object. Please refer example above. | Object | No |
## Schema Validation <a name="schema-validation"></a>
## Schema Validation
Schema service does multiple checks on different levels to make sure the inserted schema fits into validations on major, minor and patch version levels.
Following is the list of all validations that is performed while creating/updating any schema into the system.
Schema version constitutes three parts, MAJOR, MINOR, and PATCH. Depending upon the nature of changes done to the structure of schema, the application may force the user to update the version number. At a high level, the upgrading versions would be required when:
* PATCH version when you make backwards compatible bug fixes or documentation/decoration changes
* MINOR version when you add functionality or contents in a backwards compatible manner, and
* MAJOR version when you make incompatible schema changes. e.g.Whenever an attribute is removed or `type` of an attribute is updated
......@@ -260,6 +253,7 @@ Schema version constitutes three parts, MAJOR, MINOR, and PATCH. Depending upon
##### Permitted Changes for PATCH Version Increments:
Changes in the values of following attributes is permitted at patch version increment. They are non-mandatory attributes so addition or removal of any of these attributes is permitted.
* title
* description
* example/examples
......@@ -271,6 +265,7 @@ Changes in the values of following attributes is permitted at patch version incr
##### Permitted Changes for MINOR Version Increments:
In addition to all permitted changes in PATCH versions, the following actions are permitted:
1. Adding properties to existing data and nested structures
2. Adding object structures to below arrays:
* [allOf](https://json-schema.org/understanding-json-schema/reference/combining.html#allof) : To validate against `allOf`, the given data must be valid against all of the given subschemas
......@@ -292,7 +287,8 @@ It is permitted to declare existing properties as deprecated, preferable with in
##### Permitted Changes for MAJOR Version Increments:
Any changes are permitted, specifically
Any changes are permitted, specifically:
1. Removal of properties
2. Removal of structures in `allOf`, `oneOf`, `anyOf`
3. Changing the list of required properties
......@@ -310,41 +306,6 @@ Following table gives you error message when breaking change is introduced at an
| 400 | When breaking change not allowed at patch version level |Patch version validation failed. Changes requiring a minor or major version increment were found; analysed version: 2.2.15 and 2.2.14. Updating the schema version to a higher minor or major version is required.|
| 400 | When breaking change not allowed at minor version level | Minor version validation failed. Breaking changes were found; analysed versions 1013.2.0 and 1013.1.0. Updating the schema version to a higher major version is required.|
Note: The above array message would contain given schema version and existing schema in the system
## Version info endpoint
For deployment available public `/info` endpoint, which provides build and git related information.
#### Example response:
```json
{
"groupId": "org.opengroup.osdu",
"artifactId": "storage-gc",
"version": "0.10.0-SNAPSHOT",
"buildTime": "2021-07-09T14:29:51.584Z",
"branch": "feature/GONRG-2681_Build_info",
"commitId": "7777",
"commitMessage": "Added copyright to version info properties file",
"connectedOuterServices": [
{
"name": "elasticSearch",
"version":"..."
},
{
"name": "postgresSql",
"version":"..."
},
{
"name": "redis",
"version":"..."
}
]
}
```
This endpoint takes information from files, generated by `spring-boot-maven-plugin`,
`git-commit-id-plugin` plugins. Need to specify paths for generated files to matching
properties:
- `version.info.buildPropertiesPath`
- `version.info.gitPropertiesPath`
!!! note
The above array message would contain given schema version and existing schema in the system
[Back to table of contents](#TOC)
# Running Schema Service
The Schema Service is a Maven multi-module project with each cloud implementation placed in its submodule.
## AWS
Instructions for running the AWS implementation can be found [here](https://community.opengroup.org/osdu/platform/system/schema-service/-/blob/master/provider/schema-aws/README.md).
## Azure
Instructions for running the Azure implementation can be found [here](https://community.opengroup.org/osdu/platform/system/schema-service/-/blob/master/provider/schema-azure/README.md).
## Google
Instructions for running the Google implementation can be found [here](https://community.opengroup.org/osdu/platform/system/schema-service/-/tree/master/provider/schema-gc).
\ No newline at end of file
site_name: OSDU Schema Service Documentation
site_description: OSDU Schema Service
site_author: Shane Hutchins
# Repository
repo_url: https://community.opengroup.org/osdu/platform/system/schema-service
repo_name: schema
# Copyright
copyright: Copyright &copy; 2024 Open Subsurface Data Universe Software
theme:
name: material
palette:
- scheme: default
primary: indigo
accent: indigo
toggle:
icon: material/brightness-7
name: Switch to dark mode
- scheme: slate
primary: indigo
accent: indigo
toggle:
icon: material/brightness-4
name: Switch to light mode
font:
text: Roboto
code: Roboto Mono
markdown_extensions:
- admonition
- sane_lists
- tables
plugins:
- search
- git-revision-date
run-test-pages:
stage: build
image: python:latest
script:
- cd docs
- pip install mkdocs-material
- pip install mkdocs-git-revision-date-plugin
- mkdocs build --site-dir ../test
allow_failure: true
artifacts:
paths:
- test
when: manual
pages:
stage: publish
image: python:latest
tags: ["osdu-medium"]
script:
- cd docs
- pip install --default-timeout=1000 mkdocs-material
- pip install mkdocs-git-revision-date-plugin
- mkdocs build --site-dir ../public
allow_failure: true
needs: []
artifacts:
paths:
- public
# rules:
# - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment