Tokenizer json files with arrays
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
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
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 :)
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?
@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!
@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).

@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!