Blogs
📆 2025-12-22 19:34

FAQ

This document collects common questions and solutions when using Perigon.CLI. If you encounter other issues, please use the GitHub Discussions so we can continue improving this guide.

ARM Chips Not Supported

Some Apple computers use ARM chips; Perigon.CLI does not currently support ARM.

OpenAPI Issues

Microsoft’s official OpenAPI packages are still maturing, even after two major iterations. Note that describing OpenAPI with JSON Schema has inherent limitations.

The depth of the generated JSON schema exceeds the JsonSerializerOptions.MaxDepth setting

This usually stems from entity circular references. It does not honor your JsonOptions and exposes no configuration to adjust the limit. This is common, and the official OpenAPI library doesn’t yet provide an ideal solution. For example, User may have navigation properties that in turn reference User, causing this error. See the related GitHub issue.

Recommended mitigations:

  1. Recommended: return DTOs instead of raw entities.
  2. Not recommended: use [JsonIgnore] on navigation properties to break cycles at serialization time.
  3. Wait for an upstream fix.

Tip

Prefer returning DTOs rather than entities.

XML Comments Support

.NET 10 added XML comment support with some constraints:

  1. You must call services.AddOpenApi in each Web API project (uses a source generator). You cannot centralize this setup in a separate assembly.
  2. Reference OpenAPI packages directly from each Web API project; otherwise generation may fail or miss comments.

Incorrect Client Generation

Clients are generated from the OpenAPI document. If the document is incorrect, the generated clients will be too.

Suggested actions:

  1. Open an issue upstream and track for fixes.

Important

The template uses Swashbuckle.AspNetCore for OpenAPI and includes extensions to improve document quality and better support code generators.

Without Aspire

If you only have a couple of services and already have infrastructure, you can skip Aspire. Adjust as follows:

  • Remove the AppHost project.
  • Remove the ServiceDefaults project.
  • Remove MigrationsService and manage EF migrations traditionally.
  • Remove ServiceDefaults dependencies from services.
  • Configure connection strings and other settings per standard ASP.NET Core guidance.

FAQ (Frequently Asked Questions)

This document collects common problems and solutions that may be encountered when using Perigon.CLI. If you encounter other issues during use, please feel free to raise them through the GitHub Discussions. We will continuously update this document to help more users.

ARM Architecture Not Supported

Some Apple computers use ARM chips. Currently, Perigon.CLI does not support ARM architecture.

OpenAPI Issues

The official OpenAPI provided by Microsoft has not been fully developed, and there are still many issues after two major versions.

Note: Using json schema to represent openapi documents has inherent design flaws.

The depth of the generated JSON schema exceeds the JsonSerializerOptions.MaxDepth setting

This issue is usually caused by circular references between entities, and it does not align with the JsonOptions you configure, nor does it provide any configuration options to adjust it.

This is a common situation, but the official OpenAPI library has not yet provided an ideal solution.

For example, if the User entity defines multiple navigation properties, and these navigation properties reference the User entity again, this error is likely to occur. For more details, please refer to: GitHub Issue.

Solutions:

  1. ✅ Recommended: Define a new DTO when returning data, and don't return entities directly.
  2. ⚠️ Not Recommended: Add the [JsonIgnore] attribute to related properties to avoid circular references during JSON parsing.
  3. ⏳ Wait for the official library to fix the issue.

Tip

It is recommended not to return entities directly, but to return data through defined DTOs.

XML Comments Not Supported

In .NET 10, support for XML comments has been added, but there are some limitations.

  1. You must call services.AddOpenApi in the WebAPI project to inject the service because it uses a source code generator. This means you cannot reuse it in other assemblies and need to add it in every WebAPI project.

  2. You must reference the OpenAPI package dependency in the WebAPI project, and it cannot be referenced in other assemblies, otherwise it may cause errors or fail to generate related XML comments properly.

Generating Incorrect Request Services

Since request services are generated by reading OpenAPI documents, and OpenAPI may sometimes generate content that doesn't meet expectations, this can lead to issues with the generated request service code.

Solutions:

  1. Submit an Issue to the official repository and wait for a fix.

Important

The template itself uses Swashbuckle.AspNetCore to generate OpenAPI documents and provides some extension features to enhance the quality of generated documents, better supporting code generator usage.

Not Using Aspire

If you only have one or two services and the infrastructure is already existing, you can completely avoid using Aspire. You need to make the following adjustments:

  • Remove the AppHost project
  • Remove the ServiceDefaults project
  • Remove the MigrationsService project and manage database migrations in the traditional way
  • Remove ServiceDefaults dependencies in services
  • Configure connection strings and other content in services according to the standard ASP.NET Core approach