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

Tokenizer json files with arrays #43

Open
lurumad opened this issue Feb 7, 2017 · 6 comments
Open

Tokenizer json files with arrays #43

lurumad opened this issue Feb 7, 2017 · 6 comments

Comments

@lurumad
Copy link

lurumad commented Feb 7, 2017

Hi,

I have an autofac.json like this:

{
  "defaultAssembly": "WebApi",
  "modules": [
    {
      "type": "WebApi.Infrastucture.ContainerModules.DataModule, WebApi",
      "parameters": {
        "connectionString": "",
        "defaultSchema": ""
      }
    },
    {
      "type": "WebApi.Infrastucture.ContainerModules.MediatorModule, WebApi"
    }
  ]
}

Can I tokenize modules array? connectionString and defaultSchema?

Regards

@colindembovsky
Copy link
Owner

colindembovsky commented Feb 8, 2017

Hi @lurumad - no, I didn't take arrays into account. Shouldn't be too hard to build it in. Otherwise, I think I may revise my thinking around tokenizing json files for web apps. You can use parameters.xml with a regex replacement expression (as opposed to an XPath expression) so in that case you can probably do what you need using parameters.xml and WebDeploy without the intervening tokenization step.

Pull Requests are welcome :-P

@lfraile
Copy link

lfraile commented Feb 9, 2017

Great @lurumad I wanted to take some time to do it also .... but great you started it hehehe.

@colindembovsky just for you to know @lurumad is a great colleague of me here in Spain, he is a master wit TS and JS :)

@colindembovsky
Copy link
Owner

hey @lurumad @lfraile I've created a branch with some corrections (and a test) for your PR. I can't figure out how to push my code to your fork, so could you pull the https://github.com/colindembovsky/cols-agent-tasks/tree/lurumad-master branch in and then update the PR?

@colindembovsky
Copy link
Owner

@lurumad @lfraile one more thing - if you run gulp test-cover from the console you will see errors (if any). gulp test is for the builds. I'm also going to update the gulpfile.js to include gulp-typescript and get rid of the generated js files in the repo. That will make it a bit more explicit as to what js files are being used!

@Pavel-Sulimau
Copy link

@colindembovsky , Hello, I've been struggling with tokenizing an array recently. In the beginning I tried to tokenize the array of strings, like ..."ValidAudiences": [ "", "" ]..., but then I took a look at the code and realized that it would not work. So I changed the array of strings to array of objects, but it still doesn't work in TFS, though it works when I'm debugging code of tokenizer.ts. So now I have the following problem:

appsettings.json:
`
{

"DbConnection": {
    "ConnectionString": "",
    "CommandTimeout": "60"
},

"Auth": {
    "TenantId": "",
    "ResourceId": "",
    "ValidationServiceUri": "",
    "ClientId": "",
    "ClientSecret": "",
    "ValidAudiences": [
        {
            "Value": ""
        }
    ],
    "ConnectionStringKVSecretName": ""
},

"SwaggerAuth": {
    "ClientId": "",
    "Resource": "",
    "AADInstance": "",
    "Tenant": ""
},

"ApplicationInsights": {
    "InstrumentationKey": ""
},

"Logging": {
    "IncludeScopes": false,
    "LogLevel": {
        "Default": "Debug",
        "System": "Information",
        "Microsoft": "Information"
    }
}

}
`

Excludes:
DbConnection.ConnectionString,DbConnection.CommandTimeout,Logging.IncludeScopes,Logging.LogLevel.Default,Logging.LogLevel.System,Logging.LogLevel.Microsoft

and

the following error (please, see the picture).

image

@gperrego
Copy link

gperrego commented Mar 6, 2018

@colindembovsky I'm not sure if i understand, are you planning on supporting json arrays? The other question i would wonder is if you are thinking of adding xml support? Again thanks for all of your badass work!

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

No branches or pull requests

5 participants