Skip to content

Conversation

eshiota
Copy link

@eshiota eshiota commented Aug 22, 2025

Refactors the cycleThroughAttrsAndApplyValues implementation on json-logic with a more recursive-ish logic so that properties nested on allOf/anyOf/oneOf definitions are also parsed when x-jsf-logic-computedAttrs are resolved.

For instance, given the following property:

'temperature_setting': {
  'title': 'Select a preset temperature',
  'type': 'string',
  'oneOf': [
    {
      'title': 'Low',
      'const': 18,
    },
    {
      'title': 'Medium',
      'const': 20,
    },
    {
      'title': 'Maximum',
      'x-jsf-logic-computedAttrs': {
        'const': 'maximum_temperature',
      },
    },
  ],
},

the const on the last item of the property's oneOf will be properly parsed with the computed value.

@dragidavid
Copy link
Collaborator

Hey @eshiota - I think code-wise this looks pretty solid. Just as an fyi, we can always create a dev version to get things tested in a more "real" scenario!

Copy link
Collaborator

@dragidavid dragidavid left a comment

Choose a reason for hiding this comment

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

Forgot to approve last night 🤦 My bad!

Looks good

edit: I wonder why that one check is failing below. The folder was moved 🤔

@eshiota
Copy link
Author

eshiota commented Aug 26, 2025

I have no idea why that job is failing 😢 I'll close this PR and open another one

@eshiota eshiota closed this Aug 26, 2025
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