zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
114 stars 86 forks source link

False Nested Profile Schema Errors #1201

Open dkelosky opened 3 years ago

dkelosky commented 3 years ago

These nested profiles work in that I can run something like zowe files create pds "ibmuser.work.test1" --zosmf-p zosmf.fb81 and allocate a data set with attributes according to my zowe.config.json:

{
    "$schema": "./zowe.schema.json",
    "profiles": {
        "zosmf": {
            "type": "zosmf",
            "properties": {
                "port": 1443,
                "host": "my.host.net"
            },
            "profiles": {
                "fb81": {
                    "properties": {
                        "recordFormat": "FB",
                        "recordLength": 81,
                        "blockSize": 162
                    }
                }
            },
            "secure": [
                "user",
                "password"
            ],
        }
     ...

However, I get intellisense errors saying that certain properties are missing: image

Since my commands work fine, is this a bug?

MikeBauerCA commented 3 years ago

Perhaps we should support typeless profiles - did you get intellisense when typing "recordFormat"?

Typeless profiles are more of a hidden feature at the moment. One could argue that a new profile type should be created for this use case like "data-set-template".

dkelosky commented 3 years ago

@t1m0thyj gave me a workaround: if you remove everything from all required: [] arrays in the zowe.schema.json, you don't get this error.

however, the required: [] arrays I had populated were for profiles unrelated to z/osmf, e.g. MQ, IDMS, and SYSVIEW.

my use case is for things like this

MikeBauerCA commented 3 years ago

Thanks for sharing the blog, it was a nice quick read :)

I'm just wondering if you had intellisense when typing "recordFormat" because if you did, I'm thinking it would have tried to supply any matched option across all of Zowe CLI. If we had a "data-set-template" we could effectively limit the intellisense to the relevant options. What do you think of that?

Of course, typeless profiles are interesting in that they are very general and can handle use cases not yet specifically handled like you have shown in your blog.

dkelosky commented 3 years ago

i think it might be nice if there were a data-set-template, but in practice, the approach in the blog has been working well for me for quite some time.

i have no strong opinion here