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

BUG: inputs with tabs fails 'DataClasses' object has no attribute 'table' #1045

Closed
pmeyerson opened this issue Feb 5, 2024 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@pmeyerson
Copy link

Description

When I add a 2nd input to globalConfig.json and configure for tabs, ucc-gen fails with error:

Traceback (most recent call last):
  File "./myapp/.venv/bin/ucc-gen", line 10, in <module>
    sys.exit(main())
  File "./myapp/.venv/lib/python3.7/site-packages/splunk_add_on_ucc_framework/main.py", line 191, in main
    verbose_file_summary_report=args.verbose,
  File "./myapp/.venv/lib/python3.7/site-packages/splunk_add_on_ucc_framework/commands/build.py", line 698, in generate
    open_api_object = ucc_to_oas.transform(global_config, app_manifest)
  File "./myapp/.venv/lib/python3.7/site-packages/splunk_add_on_ucc_framework/commands/openapi_generator/ucc_to_oas.py", line 398, in transform
    open_api_object = __add_paths(open_api_object, global_config_dot_notation)
  File "./myapp/.venv/lib/python3.7/site-packages/splunk_add_on_ucc_framework/commands/openapi_generator/ucc_to_oas.py", line 374, in __add_paths
    actions=global_config.pages.inputs.table.actions,  # type: ignore[attr-defined]
AttributeError: 'DataClasses' object has no attribute 'table'

globalConfig.json is example taken from docs with other necessary fields.
Is the globalConfig.json wrong or is this a bug? Any way to disable the openAPI as I'm not using that.

thanks!

globalConfig.json:

{
    "pages": {
        "configuration": {
            "title": "config",
            "tabs": [
                {
                    "name": "config1",
                    "title": "config1",
                    "entity": [
                        {
                            "field": "config1",
                            "label": "config1",
                            "type": "text"
                        }]}]},
        "inputs": {
            "title": "Inputs",
            "services": [
                {
                    "name": "example_input_one",
                    "description": "This is a description for Input One",
                    "title": "Example Input",
                    "entity": [
                        {
                            "field": "name",
                            "label": "name",
                            "type": "text"
                        }
                    ],
                    "table": {
                        "actions": [
                            "edit",
                            "enable",
                            "delete",
                            "clone"
                        ],
                        "header": [
                            {
                                "field": "name",
                                "label": "name"
                            }
                        ],
                        "moreInfo": []
                    }
                },
                {
                    "name": "example_input_two",
                    "description": "This is a description for Input Two",
                    "title": "Example Input Two",
                    "entity": [
                        {
                            "field": "name",
                            "label": "name",
                            "type": "text"
                        }
                    ],
                    "table": {
                        "actions": [
                            "edit",
                            "enable",
                            "delete",
                            "clone"
                        ],
                        "header": [
                            {
                                "field": "name",
                                "label": "name"
                            }
                        ],
                        "moreInfo": []
                    }}]}},
    "meta": {
        "displayName": "config1",
        "name": "config1",
        "restRoot": "config1",
        "version": "0.3.5R5c1e48c",
        "schemaVersion": "0.0.3"
    }
}

What ucc-gen version are you using?

5.37.0

Additional System Info

No response

@pmeyerson pmeyerson added the bug Something isn't working label Feb 5, 2024
@pmeyerson
Copy link
Author

pmeyerson commented Feb 5, 2024

workaround: comment out lines 696-709 commands/build.py does not work, UI fails to load
Masking the original 404 message: 'The path '/en-US/static/@D8B1F5B6D10852DEB4968472006D15A4D9C111043B7EFADDE3FFBC77E58ACB54.1:1707145446/app/myapp/openapi.json' was not found.' with 'Page not found!' for security reasons

@artemrys
Copy link
Member

artemrys commented Feb 5, 2024

@sgoral-splunk can you please take a look?

@pmeyerson
Copy link
Author

Looks like resolved in 5.38.0, thank you!

@artemrys
Copy link
Member

artemrys commented Feb 7, 2024

Nice, I'll close this one then.

@artemrys artemrys closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants