Skip to content

APS-4443 API Prototype - #12

Merged
phowells merged 1 commit into
mainfrom
feature/api-prototype
May 1, 2026
Merged

APS-4443 API Prototype#12
phowells merged 1 commit into
mainfrom
feature/api-prototype

Conversation

@phowells

Copy link
Copy Markdown
Contributor

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

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix to populate the relationships correctly.

@@ -1,7 +1,6 @@
import {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate check for APIs.

@phowells
phowells requested review from Elson9 and rustyjux April 29, 2026 16:10

@Elson9 Elson9 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, didn't find any issues

return (
<Card>
<CardContent>
<MarkdownContent content={spec.description ?? ''} />

@rustyjux rustyjux Apr 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rustyjux

Copy link
Copy Markdown
Contributor

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:

  • OpenApi vs API type
    • presumably you made the new OpenApi type just as an alternative to API and for now we are focused on OAS as a source of truth. But to me this is confusing - shouldn't we just be updating / expanding the existing API type?
    • how are users supposed to find OpenApis? (or is this out of scope here) only the 'Access this API' button?
    • how do APIs entities relate to OpenApis?
  • Data inclusion
    • The filtering for APIs is a lot more narrow in this implementation. The vibe I've got from Drew thus far is we want to be inclusive, but I also see the value in filtering down for the prototype and then we can add transformations for a more inclusive set of APIs later
  • Entity creation
    • entityRefs are long and awkward (e.g. http://localhost:3000/catalog/default/openapi/api-specification-raw-githubuserconte-raw-githubusercontent-com). but I get you were probably shooting for uniqueness and not user-readability
  • theme renders real bad in the stock Dark Mode. but I didn't look at BC theme (in DevHub)
  • 'Dev' in Access and Onboarding card is being overwritten with the URL - see http://localhost:3000/catalog/default/openapi/api-specification-raw-githubuserconte-raw-githubusercontent-com#access-and-onboarding

@phowells
phowells merged commit 91ee0be into main May 1, 2026
3 of 4 checks passed
@phowells
phowells deleted the feature/api-prototype branch June 12, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants