-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fetch compound document #105
Changes from 4 commits
12dce95
dd829bc
7e23d19
177f102
324e4fa
24bf9a5
946280c
72e81e1
56886b5
04377e4
6a894a1
7516555
3e2287f
216eec9
392a836
1f76a4e
6a0400e
88e76aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
type: string | ||
description: ID of the category | ||
- name: entityName | ||
description: Array of strings to filter by entity names | ||
description: Array of strings to filter by entity names. Ignored if view parameter is `compound` | ||
in: query | ||
required: false | ||
schema: | ||
|
@@ -31,6 +31,13 @@ | |
schema: | ||
type: integer | ||
description: Optional query parameter to specify the number of results per page. Default value is 20 | ||
- name: view | ||
in: query | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm nervous about the performance of compound object retrieval in a list... there could be many joins that are slow to resolve. I suppose if this response is paginated then this is less of a concern. Am I correct in assuming that the purpose of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This endpoint and others that fetch data as list or compound implements pagination. with default of 20 items per page. This will alleviate fetching large mount of data. It's correct, the property |
||
required: false | ||
schema: | ||
type: string | ||
enum: ['list', 'compound'] | ||
description: Optional query parameter to specify the data representation. Choose 'list' for an unordered list of records, or 'compound' for a nested, schema-centric structure. Default is 'list'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description is a bit unclear for me. Does This feels like the options are actually "entity only" and "compound", since we get a list response in both cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point!. I see the word |
||
responses: | ||
200: | ||
description: Submitted Data | ||
|
@@ -49,6 +56,49 @@ | |
503: | ||
$ref: '#/components/responses/ServiceUnavailableError' | ||
|
||
/data/category/{categoryId}/id/{systemId}: | ||
get: | ||
summary: Retrieve Submitted Data Record for a System ID | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a new Endpoint to retrieve record by it's systemID |
||
tags: | ||
- Data | ||
parameters: | ||
- name: categoryId | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: ID of the category | ||
- name: systemId | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
description: ID of the record | ||
- name: view | ||
in: query | ||
required: false | ||
schema: | ||
type: string | ||
enum: ['list', 'compound'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are returning by id, this won't ever return a We could also try There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I like that better, good choice. |
||
description: Optional query parameter to specify the data representation. Choose 'list' for an unordered list of records, or 'compound' for a nested, schema-centric structure. Default is 'list'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a repeat of the content comments from the previous endpoint. The same parameter is duplicated, maybe we want to write a reusable definition for this parameter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved |
||
responses: | ||
200: | ||
description: Submitted Data | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/SubmittedDataRecord' | ||
400: | ||
$ref: '#/components/responses/BadRequest' | ||
401: | ||
$ref: '#/components/responses/UnauthorizedError' | ||
404: | ||
$ref: '#/components/responses/NotFound' | ||
500: | ||
$ref: '#/components/responses/ServerError' | ||
503: | ||
$ref: '#/components/responses/ServiceUnavailableError' | ||
|
||
/data/category/{categoryId}/organization/{organization}: | ||
get: | ||
summary: Retrieve Submitted Data for a specific Category and Organization | ||
|
@@ -68,7 +118,7 @@ | |
type: string | ||
description: Organization name | ||
- name: entityName | ||
description: Array of strings to filter by entity names | ||
description: Array of strings to filter by entity names. Ignored if view parameter is `compound` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
in: query | ||
required: false | ||
schema: | ||
|
@@ -88,6 +138,13 @@ | |
schema: | ||
type: integer | ||
description: Optional query parameter to specify the number of results per page. Default value is 20 | ||
- name: view | ||
in: query | ||
required: false | ||
schema: | ||
type: string | ||
enum: ['list', 'compound'] | ||
description: Optional query parameter to specify the data representation. Choose 'list' for an unordered list of records, or 'compound' for a nested, schema-centric structure. Default is 'list'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Repeat paremeter details again. Should standardize and reuse? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved |
||
responses: | ||
200: | ||
description: Submitted Data | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ | |
type: string | ||
description: A matching Dictionary Version defined on Dictionary Manager (Lectern) | ||
required: true | ||
defaultCentricEntity: | ||
type: string | ||
description: The default centric entity name | ||
Comment on lines
+23
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding new input parameter on Dictionary Registration endpoint. This is value is used to retrieve compound records |
||
responses: | ||
200: | ||
description: Dictionary info | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,8 @@ table dictionaries { | |
|
||
table dictionary_categories { | ||
id serial [pk, not null, increment] | ||
active_dictionary_id integer | ||
active_dictionary_id integer [not null] | ||
defaultCentricEntity varchar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to make this decision when we are settign the dictionary? Maybe we should instead provide the root-entity as an http request parameter, so the data requester can choose this at request time. We probably want that ability anyways, and not every dictionary will have a clear default to use. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think setting a "default" entity only once could reduce complexity to data requesters. However, I also like the idea to override the default entity at request time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be nullable, with no default provided? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
name varchar [not null, unique] | ||
created_at timestamp [default: `now()`] | ||
created_by varchar | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE "dictionary_categories" ALTER COLUMN "active_dictionary_id" SET NOT NULL;--> statement-breakpoint | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
ALTER TABLE "dictionary_categories" ADD COLUMN "defaultCentricEntity" varchar; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be careful with natural language property names... not everything is pluralized with an 's'.
I'll read through how you use these properties but at first read I want to just leave the property name as the schema name, unmodified.