APS-4443 API Prototype - #12
Conversation
Adding Prototype API mapping Add OpenAPI entity type Refactoring BCDC entity creation into separate builders Update OpenApi Entity Entity mapping and Dataset updates Updates for processor, labeling and links
| _location: unknown, | ||
| emit: CatalogProcessorEmit, | ||
| ): Promise<Entity> { | ||
| const dataset = entity as DatasetEntity; |
There was a problem hiding this comment.
This is a fix to populate the relationships correctly.
| @@ -1,7 +1,6 @@ | |||
| import { | |||
There was a problem hiding this comment.
This factory was refactored to use a builder for each entity type.
| let hasOpenApi = false; | ||
|
|
||
| for (const apiResource of apiResources) { | ||
| for (const candidate of apiResources) { |
There was a problem hiding this comment.
Added logic to identify BCDC resources with an openapi document as an OpenAPI. Other "webservice" resources are still created as the built-in API entity type.
| const bcdcDatasetResourceUrl =`${bcdcDatasetUrl}/resource/${apiResource.id}`; | ||
|
|
||
| if (isOpenApiResource) { | ||
| const normalizedDefinitionUrl = |
There was a problem hiding this comment.
Detecting duplicate OpenAPIs because multiple datasets can point to the same openapi spec and a single dataset can point to the same openapi spec multiple times.
| const existingApi = allApis.get(apiId); | ||
| const expectedApiType = apiResource.bcdc_type; | ||
|
|
||
| if (existingApi) { |
There was a problem hiding this comment.
Duplicate check for APIs.
Elson9
left a comment
There was a problem hiding this comment.
Code looks good to me, didn't find any issues
| return ( | ||
| <Card> | ||
| <CardContent> | ||
| <MarkdownContent content={spec.description ?? ''} /> |
There was a problem hiding this comment.
Sometimes HTML is used (e.g. http://localhost:3000/catalog/default/openapi/api-specification-raw-githubuserconte-raw-githubusercontent-com). Wonder if there is a component which can handle both or if we need to detect or convert. In that example it is actually a combo of Markdown + HTML, yeesh! https://raw.githubusercontent.com/bcgov/api-specs/master/router/router.json
|
Prototype entity page generally looks good and I think the factory refactor will make life easier. I have a few concerns, probably none need to be addressed now:
|
Adding Prototype API mapping
Add OpenAPI entity type
Refactoring BCDC entity creation into separate builders Update OpenApi Entity
Entity mapping and Dataset updates
Updates for processor, labeling and links