Skip to content

Commit

Permalink
[RND-623] back on track
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbanister committed Oct 10, 2023
1 parent 5ddf83a commit e7bd373
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 185 deletions.
50 changes: 15 additions & 35 deletions Meadowlark-js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Meadowlark-js/packages/meadowlark-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"xml2js": "^0.6.2"
},
"devDependencies": {
"@edfi/metaed-core": "^4.2.2-dev.5",
"@edfi/metaed-plugin-edfi-api-schema": "^4.2.2-dev.5",
"@edfi/metaed-plugin-edfi-unified": "^4.2.2-dev.5",
"@edfi/metaed-core": "^4.2.2-dev.12",
"@edfi/metaed-plugin-edfi-api-schema": "^4.2.2-dev.12",
"@edfi/metaed-plugin-edfi-unified": "^4.2.2-dev.12",
"@types/fs-extra": "^11.0.1",
"@types/inflection": "^1.13.0",
"@types/js-yaml": "^4.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ export function extractDescriptorValues(resourceSchema: ResourceSchema, document

const descriptorJsonPath: JsonPath = documentPaths.paths[descriptorKey];

const descriptorValue: any = jsonPath({
const descriptorValues: any[] = jsonPath({
path: descriptorJsonPath,
json: documentBody,
flatten: true,
});

const documentIdentity: DocumentIdentity = [
{ documentKey: 'descriptor' as DocumentObjectKey, documentValue: descriptorValue },
];
const documentIdentity: DocumentIdentity = descriptorValues.map((descriptorValue) => ({
documentKey: 'descriptor' as DocumentObjectKey,
documentValue: descriptorValue,
}));

result.push({
documentIdentity,
Expand Down
23 changes: 23 additions & 0 deletions Meadowlark-js/packages/meadowlark-core/test/TestHelper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: Apache-2.0
// Licensed to the Ed-Fi Alliance under one or more agreements.
// The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
// See the LICENSE and NOTICES files in the project root for more information.

import type { Enhancer, MetaEdEnvironment, PluginEnvironment } from '@edfi/metaed-core';
import { initialize as edfiApiSchema } from '@edfi/metaed-plugin-edfi-api-schema';
import type { ApiSchema } from '../src/model/api-schema/ApiSchema';

type PluginEnvironmentEdfiApiSchema = {
apiSchema: ApiSchema;
};

export function apiSchemaFrom(metaEd: MetaEdEnvironment): ApiSchema {
metaEd.plugin.set('edfiApiSchema', {} as PluginEnvironment);

edfiApiSchema().enhancer.forEach((enhancer: Enhancer) => {
enhancer(metaEd);
});

const pluginEnvironment = metaEd.plugin.get('edfiApiSchema') as PluginEnvironment;
return (pluginEnvironment.data as PluginEnvironmentEdfiApiSchema).apiSchema;
}
Loading

0 comments on commit e7bd373

Please sign in to comment.