api/

directory
v0.35.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2024 License: Apache-2.0

README

API models

This directory includes API version specific models from open api specs. The models in this directory is used for serializing/deserializing request and response. datamodels has the converters to convert between version specific models and datamodels. datamodels will be used for internal controller and datastorage.

Generate new models

Prerequisites
  1. Install NodeJS
  2. Install AutoRest
npm install -g autorest
Add new api-version
  1. Add api version tags and openapi file below in this README.md
  2. Run autorest.
autorest README.md --tag=core-2023-10-01-preview
  1. Create or modify the corresponding datamodels in datamodel
  2. Add the converter between versioned model and datamodel in converter

Configuration

The following are the settings for this using this API with AutoRest.

Input OpenAPI specifications
Tag: core-2023-10-01-preview

These settings apply only when --tag=core-2023-10-01-preview is specified on the command line.

input-file:
  - ../../../swagger/specification/applications/resource-manager/Applications.Core/preview/2023-10-01-preview/openapi.json

modelerfour: 
  treat-type-object-as-anything: false
Common

The following configuration generates track2 go models and client.

version: 3.*.*
use: "@autorest/go@4.0.0-preview.55"
module-version: 0.0.1
file-prefix: zz_generated_
license-header: "Licensed under the Apache License, Version 2.0 . See LICENSE in the repository root for license information.\nCode generated by Microsoft (R) AutoRest Code Generator.\nChanges may cause incorrect behavior and will be lost if the code is regenerated."
azure-arm: true
Output
Tag: core-2023-10-01-preview

These settings apply only when --tag=core-2023-10-01-preview is specified on the command line.

output-folder: ./v20231001preview

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL