Hi, I'm trying to work on a proof of concept using Radzen, before we purchase a pro license. We have an Azure API Management backend which I can export to Swagger/Open API specs. My Idea was to use on Radzen's side to generate everything needed.
I am having issues with the data code generation. I have a simple Open API spec with just a single GET endpoint, that just returns an array of objects with 3 properties id, name, randominfo.
Radzen recognizes my endpoint and definition.
Here is my Swagger file.
{
"swagger": "2.0",
"info": {
"title": "PSA",
"version": "1.0",
"description": "PSA Product"
},
"host": "redacted.azure-api.net",
"basePath": "/psa",
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"paths": {
"/ReturnData": {
"get": {
"operationId": "get-returndata",
"summary": "ReturnData",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/Data"
},
"examples": {
"application/json": [
{
"id": 0,
"Name": "string",
"RandomInfo": "string"
}
]
}
}
}
}
}
},
"definitions": {
"Data": {
"type": "array",
"items": {
"required": [
"id",
"Name",
"RandomInfo"
],
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"Name": {
"type": "string"
},
"RandomInfo": {
"type": "string"
}
}
}
}
},
"tags": []
}
When I use a DataGrid, it's able to see my properties and use them in the builder, but when I go build/run the app, it returns multiple errors, all seem to stem from a bad reference of "Models".
radzen: Generating code ...
radzen: Code generation done in 202ms.
dotnet: dotnet watch 🚀 Started
dotnet: ...\Web\client\Pages\Home.razor.designer.cs(10,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
dotnet: ...\Web\client\Services\GlobalsService.cs(6,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Services\GlobalsService.cs(7,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Services\PsaProductService.cs(11,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Shared\LoginLayout.razor.designer.cs(9,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Shared\MainLayout.razor.designer.cs(9,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Pages\Home.razor(8,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Shared\LoginLayout.razor(5,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Services\PsaProductService.cs(29,27): error CS0246: The type or namespace name 'Data' could not be found (are you missing a using directive or an assembly reference?) [...\Web\client\Concept.Client.csproj]
...\Web\client\Shared\MainLayout.razor(5,15): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Concept' (are you missing an assembly reference?) [...\Web\client\Concept.Client.csproj]
dotnet:
dotnet: The build failed. Fix the build errors and run again.
dotnet:
dotnet: dotnet watch ❌ Exited with error code 1
dotnet: dotnet watch ⏳ Waiting for a file to change before restarting dotnet...
Appreciate any assistance.