-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
In order to properly function, a config file must exist in the web csproj root directory named "typeRightConfig.json". The schema will be added to the JSON file if you create it from the extension (right click project >> Add Config File). If you created the file manually, you can add the $schema property to your json file with the link to the raw schema. It is located under /src/TypeRight.Core/Configuration (example below).
It is recommended that you use the schema for the version you are on. The extension has a convenient option for upgrading the typeRightConfig.json file if the schema is out of date. You can do this by right clicking the typeRightConfig.json file >> TypeRight >> Upgrade Config action.
For example, if you were on version 1.1, your schema url will look like https://github.com/someguy20336/TypeRight/v1.1.0/src/TypeRight.Core/Configuration/typeRightConfig-schema.json
Starting in version 1.4, your schema url will look like (with the "tool" namespace): https://github.com/someguy20336/TypeRight/tool/v1.4.0/src/TypeRight.Core/Configuration/typeRightConfig-schema.json
Opening this file in Visual Studio will give intellisense, so you can see more explanation there.
{ // This schema is used for intellisense in visual studio "$schema": "https://github.com/someguy20336/TypeRight/tool/v1.4.0/TypeRight.Core/Configuration/typeRightConfig-schema.json", // set to "true" to enable script generation, or false to disable it "enabled": boolean, // The relative path from the csproj to write the result of the the default generated classes and interfaces "serverObjectsResultFilepath": string, // The base url of the entire project when deployed (if running under an IIS application, for example - "/api"). This is appended // to the beginning of very URL "baseUrl": string // Query parameters to append to every request. See the controller actions page for more details. "queryParams": string or key/value object, // how name casing should be handled for properties and actions. By default, property name casing is NOT changed. // In all cases, `JsonPropertyName` or `JsonProperty` will override the name for a property. "nameCasingConverter": "camel" or "none", // How imports should be in the typescript file. options include // - extensionless: (default) where the .ts is stripped // - replaceWithJs: where the .ts is replaced with .js "importModuleNameStyle": string, // Configure a single fetch wrapper function "fetchConfig": { // The name of the function (i.e. "fetchWrapper") "name": string, // The relative filepath from the csproj to the typescript file containing this function. "filePath": string, // The return type of the function. Typically "Promise<$returnType$>" "returnType": string, // This would be used to append any additional imports that otherwise wouldn't automatically be added (i.e. your return type) "imports": [ { // The array of items to import. For example ["MyClass", "myFunction", ... ] items: string[], // The relative filepath from the csproj to the file containing these items path: string } ], // This defines the parameters to your fetch function // Three built in types are "url", "body", and "requestMethod" // Otherwise, define an object with a { "name": string, "type": string, "optional": boolean } "parameters": [ // see comment above ] } }