# IntOrStringYamlConverter

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Yaml`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Yaml/IntOrStringConverter.cs)
- Implements: `IYamlTypeConverter`

Provides a custom YAML type converter that facilitates serialization and deserialization of objects of type [Int32OrStringV1](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md). This converter supports both integers and strings.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Yaml;

public class IntOrStringYamlConverter
    : YamlDotNet.Serialization.IYamlTypeConverter
{
    // ...
}
```

## Constructors

- [IntOrStringYamlConverter](/reference/api/csharp/aspire.hosting.kubernetes/intorstringyamlconverter/constructors.md#constructor)

## Methods

- [Accepts(Type)](/reference/api/csharp/aspire.hosting.kubernetes/intorstringyamlconverter/methods.md#accepts-type) : `bool` -- Determines whether the given type is supported by this YAML type converter.
- [ReadYaml(IParser, Type, ObjectDeserializer)](/reference/api/csharp/aspire.hosting.kubernetes/intorstringyamlconverter/methods.md#readyaml-iparser-type-objectdeserializer) : `object?` -- Reads a YAML scalar from the parser and converts it into an instance of [Int32OrStringV1](/reference/api/csharp/aspire.hosting.kubernetes/int32orstringv1.md).
- [WriteYaml(IEmitter, object?, Type, ObjectSerializer)](/reference/api/csharp/aspire.hosting.kubernetes/intorstringyamlconverter/methods.md#writeyaml-iemitter-object-type-objectserializer) -- Writes the given object to the provided YAML emitter using the appropriate format.
