Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental API 3 - Versioned Model #1693

Closed
Zejnilovic opened this issue Feb 17, 2021 · 1 comment · Fixed by #2046, #2052, #2055 or #2066
Closed

Experimental API 3 - Versioned Model #1693

Zejnilovic opened this issue Feb 17, 2021 · 1 comment · Fixed by #2046, #2052, #2055 or #2066
Assignees
Labels
feature New feature Menas Menas component affected priority: undecided Undecided priority to be assigned after discussion under discussion Requires consideration before a decision is made whether/how to implement

Comments

@Zejnilovic
Copy link
Contributor

Zejnilovic commented Feb 17, 2021

Background

3rd part of the API rewrite.
Approach this as a PoC.
API is enough. Do not touch UI.
Think about where Envelope makes sense

Feature

All of this should be put under profile "api-experimental" in spring or a feature switch

  • /{model}
    • GET return list of {model} and maybe latest versions
      • Optional param searchQuery
    • POST create or update {model}
  • /{model}/import imports a single entity. Updates or creates
  • /{model}/{name}
    • GET Returns list of versions available
    • POST update - full object
    • DELETE disable
  • /{model}/{name}/audit-trail gets audit trail
  • /{model}/{name}/{version}
    • Or keyword latest
    • GET returns the specific {model}
    • Extra? - POST?PUT to update with partial body?
    • DELETE disables - on {name} might be enough
  • /{model}/{name}/{version}/validate gets a validation report
  • /{model}/{name}/{version}/properties
    • Get the properties
    • /{propertyName} for specific property then GET and POST
  • /{model}/{name}/{version}/used-in
    • Get the list of places this is used in
      - Would something similar be useful on {name}?
  • /{model}/{name}/{version}/export
  • /datasets/{name}/{version}/rules
    • GET get the rules defined
    • POST create rule ?? Allow position/order to be specified ??
    • /{number or order}
      • GET get the specific rule
      • POST to update the rule
      • DELETE to delete the rule
      • Q: /reorder POST
  • /mapping-tables/{name}/{version}/defaults
    • GET all defaults
    • POST create a default
    • /{column name} to get the specific default
      • DELETE to delete the rule
  • /schema/{name}/{version}/json
  • /schema/{name}/{version}/original-file
  • /schema/{name}((/{version}))/upload - this needs a PoC. Do we want 3 endpoints or one?
@Zejnilovic Zejnilovic added feature New feature Menas Menas component affected under discussion Requires consideration before a decision is made whether/how to implement priority: undecided Undecided priority to be assigned after discussion labels Feb 17, 2021
@dk1844 dk1844 self-assigned this Mar 4, 2022
dk1844 added a commit that referenced this issue Mar 7, 2022
…e contours, empty DatasetControllerV3 to test
dk1844 added a commit that referenced this issue Mar 7, 2022
 - login allowed at /api/login & /api-v3/login
 - v2/v3 BaseRestApiTest distinquished
dk1844 added a commit that referenced this issue Mar 21, 2022
dk1844 added a commit that referenced this issue Mar 23, 2022
dk1844 added a commit that referenced this issue Mar 24, 2022
dk1844 added a commit that referenced this issue Mar 24, 2022
…st and post-import + IT to prove correct behavior
dk1844 added a commit that referenced this issue Mar 24, 2022
…mport + IT to prove correct behavior - fix with common location processing with segment stripping (+normalization)
dk1844 added a commit that referenced this issue Mar 24, 2022
dk1844 added a commit that referenced this issue Mar 24, 2022
dk1844 added a commit that referenced this issue Mar 24, 2022
…ion} now works for # or 'latest' (IT = regression test)
dk1844 added a commit that referenced this issue Mar 24, 2022
…{name}/{version} and /{name}/latest - improved
dk1844 added a commit that referenced this issue Mar 24, 2022
…- supports latest for as version-expression, impl for datasets improved by actual existence checking + IT test cases for non-existing/non-latest queries
dk1844 added a commit that referenced this issue Mar 30, 2022
…properties - supports latest for as version-expression; get impl is unvalidated, put impl checks validity

 - login is now common, under /api/login for both v2 and v3 (did not work previously)
dk1844 added a commit that referenced this issue Mar 30, 2022
…properties - supports latest for as version-expression; get impl is unvalidated, put impl checks validity - extended for different validation cases

 - login is now common, under /api/login for both v2 and v3 (did not work previously)
dk1844 added a commit that referenced this issue Mar 30, 2022
…ture -> CompletableFuture (mistake reverted)
dk1844 added a commit that referenced this issue Mar 30, 2022
… added. IT mostly adjusted, but there are todos

 - DatasetServiceV3 introduced to carry difference in behavior to DatasetService. original entity validation has been divided into create-validation and regular-entity validation.
 - buildfix for VersionedModelServiceTest
dk1844 added a commit that referenced this issue Mar 31, 2022
dk1844 added a commit that referenced this issue Apr 1, 2022
…asets/dsName/version/rules, GET datasets/dsName/version/rules/# + IT
dk1844 added a commit that referenced this issue Apr 6, 2022
dk1844 added a commit that referenced this issue Apr 6, 2022
 - v2 ignores this added information
 - needs
dk1844 added a commit that referenced this issue May 5, 2022
…authentication)")` is now limited to changing endpoints of PropertyDefinitionControllerV3 (previously it was incorrectly used for all changing endpoints. IT updated. And specific check for the adminRole have been added to PropertyDefinitionControllerV3IntegrationSuite.
dk1844 added a commit that referenced this issue May 6, 2022
dk1844 added a commit that referenced this issue May 9, 2022
dk1844 added a commit that referenced this issue May 9, 2022
dk1844 added a commit that referenced this issue May 9, 2022
* #1693 API v3: VersionedModel v3 - VersionedModelControllerV3 , DatasetControllerV3 
 - login allowed at /api/login (common)
 - v2/v3 BaseRestApiTest distinquished
 - location header for put/post and post-import 
 - /{name}/{version}/used-in - supports latest for as version-expression, impl for datasets improved by actual existence checking + IT test cases for non-existing/non-latest queries
 - /{name}/{version}/validation` impl added
 - conformance rule mgmt GET+POST datasets/dsName/version/rules, GET datasets/dsName/version/rules/# + IT
 - Swagger API: dev-profile: full v2+v3 API, non-dev: full v3 API
 - IT testcases
@dk1844
Copy link
Contributor

dk1844 commented May 9, 2022

Release notes
/api-v3/{datasets|schemas|mapping-tables|property-defintions}/ Rest API V3 added.
Schema is now updatable via entity payload as well (outside of attachment upload).
Includes checks on entities and is to be used externally.
The API is now truly RESTful (endpoint naming, structure, methods, Location header on creating responses).
Also, Swagger API doc reacts to Spring dev profile (JVM arg -Dspring.profiles.active=dev) to show legacy V2 API doc.
Also, /api-v3/{datasets|schemas|mapping-tables|property-definitions/datasets}/{name}/used-in and /api-v3/{datasets|schemas|mapping-tables|property-definitions/datasets}/{name}/{version}/used-in REST API V3 added, the former is used for disable requests to check the dependencies. Entities are now disabled and enabled entirely (all versions).
UsedIn normalization introduced.

dk1844 added a commit that referenced this issue May 9, 2022
… with `MappingTableControllerV3.withMappingTableToResponse`
dk1844 added a commit that referenced this issue May 10, 2022
* #1693
 - API v3 impl for MTs + ITs
   - Mt existence check for DS rules + reflecting in integTest
 - API v3 impl for MTs for schemas schema  + validation for DSs + IntegTest update
   - POST, .../json, .../original, .../from-file
   - json 400 with validation errors on empty fields + PUT/POST with schema with empty fields -> 400 validation error, too. + ITs reflecting this (this reqiured parallel SchemaServiceV3)
 - Swagger differs in paths based on `spring.profiles.active` being `dev` or not.
 - PR review updates
dk1844 added a commit that referenced this issue May 16, 2022
dk1844 added a commit that referenced this issue May 16, 2022
 - custom isDisabledCheck is not needed anymore (V3 services use `validate` for this)
 - `EntityDisabledException` removed, replaced by a `Validation` with `disabled` key.
 - validation fixed for Schemas (did not include super-check)
 - V3 integTests updated to cover the `disabled` = validation fail
dk1844 added a commit that referenced this issue May 17, 2022
… an error message (`UsedIn` wrapped in `EntityInUseException`)
dk1844 added a commit that referenced this issue May 18, 2022
dk1844 added a commit that referenced this issue May 24, 2022
* #1693 API v3: VersionedModel v3 disable/enable + usedIn
 - integrationTest cases added
 - 2 levels of .../used-in exist ( /{name}/used-in & /{name}/{version}/used-in). The former is used in disable checking.
 - UsedIn - empty/nonEmpty normalization  V2 alternated between None and Some(Seq.empty) in various places, V3 consistently returns None for no references groups.
 - `NamedLatestVersion` generalized into a multipurpose `NamedVersion`. Small updates, thanks @benedeki
 - API v3 summary (NamedVersion) now contains `disabled` information - mainly on GET ...{/name}
- disable fail due to nonEmpty used in now carries a wrapper with an error message (`UsedIn` wrapped in `EntityInUseException`)
- Future {throw x}` replaced with `Future.failed(x)` in rest_api, cleanup
dk1844 added a commit that referenced this issue May 24, 2022
dk1844 added a commit that referenced this issue May 24, 2022
dk1844 added a commit that referenced this issue May 31, 2022
* #1693 As `disabled` flag cases to fail validation:
 - custom isDisabledCheck is not needed anymore (V3 services use `validate` for this)
 - `EntityDisabledException` removed, replaced by a `Validation` with `disabled` key.
 - validation fixed for Schemas (did not include super-check)
 - V3 integTests updated to cover the `disabled` = validation fail

* #1693 disable fail due to nonEmpty used in now carries a wrapper with an error message (`UsedIn` wrapped in `EntityInUseException`)

* #1693 `Future {throw x}` replaced with `Future.failed(x)` in rest_api, cleanup
@dk1844 dk1844 closed this as completed Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature Menas Menas component affected priority: undecided Undecided priority to be assigned after discussion under discussion Requires consideration before a decision is made whether/how to implement
Projects
None yet
2 participants