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

Tighter definition for "otherConfig" in fdc3.chart context type #856

Closed
Tracked by #916 ...
rbruckheimer opened this issue Nov 15, 2022 · 1 comment · Fixed by #985 or #994
Closed
Tracked by #916 ...

Tighter definition for "otherConfig" in fdc3.chart context type #856

rbruckheimer opened this issue Nov 15, 2022 · 1 comment · Fixed by #985 or #994
Labels
Context Data & Intents Contexts & Intents Discussion Group context-data FDC3 Context Data Working Group enhancement New feature or request
Milestone

Comments

@rbruckheimer
Copy link

rbruckheimer commented Nov 15, 2022

Enhancement Request

Use Case:

The otherConfig section of the fdc3.chart context type message allows additional directives to be sent to the resulting chart, such as indicators and annotations. As it stands now, all target applications that acknowledge otherConfig will attempt to digest its contents without actually knowing if it is intended for them. This can cause unintended consequences when a message tailored for one app is misinterpreted by another app.

Workflow Description

Rather than looking like this:

otherConfig: {
        indicators: [
            {
                name: "ma",
                parameters: {
                    period: 14,
                    type: "ema"
                }
            },
            {
                name: "volume"
            }
        ]
}

the otherConfig section ought to look like this:

otherConfig: {
        configs: [
            {
                type: "[vendor.product.indicator]"
                name: "ma",
                parameters: {
                    period: 14,
                    type: "ema"
                }
            },
            {
                type: "[vendor.product.indicator]"
                name: "volume"
            }
        ]
}

In this way, different products can digest only the configurations pertaining to them.

Workflow Examples

This block will send the same indicator to different vendors who process them differently:

otherConfig: {
	configs: [
		{
			type: "somevendor.someproduct.indicator",
			name: "stddev",
			parameters: {
				period: 10,
				matype: "exponential"
			}
		},
		{
			type: "someothervendor.someotherproduct.formula",
			formula: "standard-deviation",
			fields: {
				lookback: 10,
				type: "ema"
			}
		}
	]
}

Additional Information

Schema change:

"otherConfig": {
	"type": "object"
}

changes to:

"otherConfig": {
	"type": "object",
	"additionalProperties": { 
		"type": "array",
		"items": {
			"$ref": "context.schema.json#"
		} 
	}
}
@kriswest
Copy link
Contributor

@rbruckheimer I think this would be cleaner without a redundant layer, i.e. do this:

otherConfig: [
    {
        type: "somevendor.someproduct.indicator",
	    ...
    },
    { ... }
]

rather than this:

otherConfig: {
	configs: [
		{
			type: "somevendor.someproduct.indicator",
			...
		},
		{ ... }
	]
}

I've implemented this in PR #985 - could you take a look and confirm that you are happy with that. You can see the docs preview for it at: https://deploy-preview-985--fdc3.netlify.app/docs/next/context/ref/Chart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context Data & Intents Contexts & Intents Discussion Group context-data FDC3 Context Data Working Group enhancement New feature or request
Projects
None yet
2 participants