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

Storebindings #19

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Storebindings #19

wants to merge 16 commits into from

Conversation

mattdfuchs
Copy link
Contributor

Updates to support full import and export. Works for CIM (almost). Added PluginController class to choose between multiple plugins. Should be easily called from the UI. There is still a minor issue with cim version.

"@api-modeling/api-modeling-metadata": "^0.1.3",
"@api-modeling/amf-client-js": "^4.1.12",
"@api-modeling/api-modeling-metadata": "^0.1.4",
"@api-modeling/metadata-store": "^0.1.17",
Copy link
Contributor

Choose a reason for hiding this comment

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

Model-bindings cannot depend on the metadata-store

@@ -13,7 +13,7 @@ import {ApiGenerator} from "./utils/apiGenerator";
const SUPPORTED_FORMATS = [ApiParser.RAML1, ApiParser.OAS3 + ".0", ApiParser.OAS2, ApiParser.AMF_GRAPH, ApiParser.JSON_SCHEMA];
const SUPPORTED_SYNTAXES = [ApiParser.YAML, ApiParser.JSONLD, ApiParser.JSON]

export class APIContractBindingsPlugin extends BindingsPlugin {
export class APIContractBindingsPlugin /* extends BindingsPlugin */{
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to extend BindignsPlugin


/**
* Some external resource plugins will work with. Just a URL identifying the resource and the text of the resource.
*/
export interface Resource {
url: string
text: string
text?: string
Copy link
Contributor

Choose a reason for hiding this comment

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

How can you get or generate a resource without data?

/**
* Common interface for all bindings plugins
*/
export abstract class BindingsPlugin {
constructor(){}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

let graph = namedNode(regime)
let bindingDeclarationSource = namedNode(bindingDeclSrc)
let stupid = `file://${process.cwd()}/node_modules/@api-modeling/api-modeling-metadata/model/bindings/schema/modelBindingsDialect.yaml#/declarations/Binding`
store.addQuad(bindNode, rdfType, bindName,graph)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we adding this to the store? If you generate bindings, add them to a bindings model

return [];
}
}
export function findPathOld(store: n3.Store, subject: n3.Quad_Object, path: n3.Quad_Object[]): n3.Quad_Object|null {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still in use? Remove if not

@@ -0,0 +1,262 @@
import {DialectWrapper, ModularityDialect, Module, Entity, Attribute, Association, IntegerScalar, StringScalar, DataModel, DataModelDialect, ModelBindingsDialect, BindingsModel, Binding, BindingArrayValue} from "@api-modeling/api-modeling-metadata";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this file here?

@@ -1,95 +0,0 @@
import { describe } from 'mocha'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this removed?

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.

2 participants