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

Use JSON Pointer for inputData and outputData #69

Open
mjkoster opened this issue Aug 26, 2019 · 6 comments
Open

Use JSON Pointer for inputData and outputData #69

mjkoster opened this issue Aug 26, 2019 · 6 comments
Assignees
Labels
Blocks Pressure Test This blocks one of the models selected for pressure test bug Something isn't working F2F4 Resolved Review PR

Comments

@mjkoster
Copy link
Contributor

mjkoster commented Aug 26, 2019

Rather than create a new class for different uses of data, we should define inputData and outputData for Actions and Events as pointers to odmData definitions, using the same pattern as for required (#68):

odmObject {
  Brightness {
    required [ 
      { $ref 0/odmData/currentBrightness }
      { $ref 0/odmAction/setBrightness }
    ]
    odmProperty {
      currentBrightness {
        type number
      }
    }
    odmAction {
      setLevel { 
        inputData [
          { $ref 0/odmData/targetBrightness }
          { $ref 0/odmData/transitionTime }
        ]
        required [
          { $ref 0/odmData/targetBrightness }
        ]
        odmData {
          targetBrightness {
            type number
          }
          transitionTime {
            type number
          }
        }
      }
    }
  }
}
@mjkoster mjkoster changed the title Use JSON Pointer for inputData and outputDAta Use JSON Pointer for inputData and outputData Aug 26, 2019
@mjkoster mjkoster self-assigned this Aug 28, 2019
@mjkoster mjkoster added Blocks Pressure Test This blocks one of the models selected for pressure test bug Something isn't working labels Aug 28, 2019
@mjkoster
Copy link
Contributor Author

mjkoster commented Aug 28, 2019

See #38, #40, and #63

@WAvdBeek
Copy link
Collaborator

can the example be in JSON?

@mjkoster
Copy link
Contributor Author

{
  "odmObject": {
    "Brightness": {
      "required": [
        {
          "$ref": "0/odmData/currentBrightness"
        }, 
        {
          "$ref": "0/odmAction/setBrightness"
        }
      ], 
      "odmProperty": {
        "currentBrightness": {
          "type": "number"
        }
      }, 
      "odmAction": {
        "setLevel": {
          "inputData": [
            {
              "$ref": "0/odmData/targetBrightness"
            }, 
            {
              "$ref": "0/odmData/transitionTime"
            }
          ], 
          "required": [
            {
              "$ref": "0/odmData/targetBrightness"
            }
          ], 
          "odmData": {
            "targetBrightness": {
              "type": "number"
            }, 
            "transitionTime": {
              "type": "number"
            }
          }
        }
      }
    }
  }
}

@asoloway64
Copy link
Contributor

F2F4: Add "odmInputRequired" at "odmAction" level. This is not needed for "odmEvent", because "odmRequired" is already available. "odmRequired" is applied to objects, actions (output) and events (output).

@mjkoster
Copy link
Contributor Author

Added "odmRequiredInputData" to qualities of odmAction

@mjkoster
Copy link
Contributor Author

I think we might want to reconsider using odmRequiredOutputData to provide a more explicit definition. IOW, Actions would have required input data and output data to be more consistent with the input data and output data definitions.

Likewise, odmEvents would have the odmRequiredOutputData quality instead of odmRequired

odmRequired would still be used to specify required properties, actions, events in an object, etc.

odmData would still use JSON schema...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocks Pressure Test This blocks one of the models selected for pressure test bug Something isn't working F2F4 Resolved Review PR
Projects
None yet
Development

No branches or pull requests

3 participants