зеркало из
1
0
Форкнуть 0
autorest.modelerfour/modelerfour
Garrett Serack 8c2450f2b5 make sure client apiversion parameter ends up in global set 2020-01-13 11:15:09 -08:00
..
example flattner started, made no hosts mean gimme host 2019-11-19 15:24:24 -08:00
flattener disable flattener for the moment 2020-01-10 11:59:22 -08:00
modeler make sure client apiversion parameter ends up in global set 2020-01-13 11:15:09 -08:00
prenamer update to new testserver, fix inline enum x-ms-client-name, more work on flattener 2019-12-19 10:45:11 -08:00
test make sure client apiversion parameter ends up in global set 2020-01-13 11:15:09 -08:00
.eslintignore initial import -- modeler four 2019-09-23 13:22:04 -07:00
.eslintrc.yaml initial import -- modeler four 2019-09-23 13:22:04 -07:00
.npmignore initial import -- modeler four 2019-09-23 13:22:04 -07:00
LICENSE initial import -- modeler four 2019-09-23 13:22:04 -07:00
main.ts make sure flattener is called right, add x-ms-skip-url-encoding for parameters 2020-01-09 13:46:51 -08:00
package.json updated script 2019-12-19 10:51:29 -08:00
readme.md update to new testserver, fix inline enum x-ms-client-name, more work on flattener 2019-12-19 10:45:11 -08:00
tsconfig.json initial import -- modeler four 2019-09-23 13:22:04 -07:00

readme.md

AutoRest Modeler Four

Changelog:

(patch-level changes)

  • properties should respect x-ms-client-name
  • global parameters should try to be in order of original spec
  • filter out 'x-ms-original' from extensions
  • add serializedName for host parameters
  • make sure reused global parameter is added to method too
  • processed values in constants/enums a bit better, support AnySchema for no type/format
  • support server variable parameters as method unless they have x-ms-parameter-location

4.2.75 - bug fixes:

  • add style to parameters to support collection format
  • potential-breaking-change Include common paramters from oai/path #68 (requires fix from autorest-core 3.0.6160+ )
  • propogate extensions from server parameters (ie, x-ms-skip-url-encoding) #61
  • potential-breaking-change make operation groups case insensitive. #59
  • potential-breaking-change sealedChoice/Choice selection was backwards ( was creating a sealedchoice schema for modelAsString:true and vice versa) #62
  • potential-breaking-change drop constant schema from response, use constantschema's valueType instead. #63
  • potential-breaking-change fix body parameter marked as required when not marked so in spec. #64

4.1.60 - add missing serializedName on parameters

  • query parameters should have a serializedName so that they don't rely on the cosmetic name property.

4.1.58 - Breaking change:

  • version bump, change your configuration to specify version ~4.1.0 or greater
use-extension:
  "@autorest/modelerfour" : "~4.1.0" 
  • each Http operation (via .protocol.http) will now have a separate path and uri properties.
    Both are still templates, and will have parameters.
    The parameters for the uri property will have in set to ParameterLocation.Uri
    The parameters for the path property will continue to have in set to ParameterLocation.Path

  • autorest-core recently added an option to aggressively deduplicate inline models (ie, ones without a name) and modeler-four based generator will have that enabled by default. (ie deduplicate-inline-models: true)
    This may increase deduplication time on extremely large openapi models.

  • this package contains the initial code for the flattener plugin, however it is not yet enabled.

  • updated @azure-tools/codemodel package to 3.0.241:
    uri (required) was added to HttpRequest
    flattenedNames (optional) was added to Property (in anticipation of supporting flattening)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Autorest plugin configuration

ModelFour Options

You can specify the following options in your configuration for modelerfour:

``` yaml
modelerfour: 
  # this will speed up the serialization if you explicitly say you do or do not want yaml tags in the model
  # default - both
  emit-yaml-tags: undefined|true|false

  # this will flatten modelers marked with 'x-ms-client-flatten' 
  # defaults to true if not specified
  flatten-models: true|false    

  # this will flatten parameters when payload-flattening-threshold is specified (or marked in the input spec)
  # defaults to true if not specified
  flatten-payloads: true|false  
  
  # this runs a pre-namer step to clean up names 
  # defaults to true if not specified
  prenamer: true|false          

  # merges response headers into response objects 
  # defaults to false if not specified
  # (not implemented yet)
  merge-response-headers: false|true 
```

ModelerFour

pipeline-model: v3
modelerfour-loaded: true
pipeline:
  modelerfour:
    input: openapi-document/multi-api/identity  

  modelerfour/new-transform:
    input: modelerfour

  modelerfour/pre-namer:
    input: modelerfour/new-transform

  modelerfour/pre-namer/new-transform:
    input: modelerfour/pre-namer

  modelerfour/flattener:
    input: modelerfour/pre-namer/new-transform

  modelerfour/flattener/new-transform:
    input: modelerfour/flattener

  modelerfour/identity:
    input: modelerfour/flattener/new-transform

  modelerfour/emitter:
    input: modelerfour/identity
    scope: scope-modelerfour/emitter

  modelerfour/notags/emitter:
    input: modelerfour/identity
    scope: scope-modelerfour/notags/emitter

scope-modelerfour/emitter: # writing to disk settings
  input-artifact: code-model-v4
  is-object: true # tells autorest that it is an object graph instead of a text document
  output-uri-expr: | # forces filename if it gets written to disk.
    "code-model-v4.yaml"  
    
scope-modelerfour/notags/emitter: # writing to disk settings
  input-artifact: code-model-v4-no-tags
  is-object: true # tells autorest that it is an object graph instead of a text document
  output-uri-expr: | # forces filename if it gets written to disk.
    "code-model-v4-no-tags.yaml"  

# the default preference for modeler-four based generators is to deduplicate inline models fully.
# this may impact performance on extremely large models with a lot of inline schemas.
deduplicate-inline-models: true