MicrosoftDocs / vsts-rest-api-specs

MIT License
158 stars 114 forks source link

Wrong information for CreatePipelineConfigurationParameters in Pipelines - Create #517

Open ghost opened 2 years ago

ghost commented 2 years ago

Wrong documentation in https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/create?view=azure-devops-rest-7.1.

Request body to create pipeline, points wrongly to ConfigurationType:

image

It seems that docs maintainer copy-paste the same information for PipelineConfiguration:

image

ConfigurationType doesn't show parameters required to Create Pipeline, just the type of the pipeline:

image

stil4m commented 2 years ago

I've ran into the same problem.

I generate my client code, so this leaves me in a situation where I still have to create my own code. Would be nice if the spec can be fixed, such that I can generate the proper client code.

johnowl commented 2 years ago

I have the same problem that @stil4m reported.

nechvatalp commented 1 year ago

I will notify the team owning this API about this issue so they can sort it out.

nechvatalp commented 1 year ago

The CreatePipelineConfigurationParameters does indeed accept ConfigurationType as far as I can tell however ConfigurationType is enum defines as this

    public enum ConfigurationType
    {
        /// <summary>
        /// Unknown type.
        /// </summary>
        Unknown = 0,

        /// <summary>
        /// YAML.
        /// </summary>
        Yaml = 1,

        /// <summary>
        /// Designer JSON.
        /// </summary>
        DesignerJson = 2,

        /// <summary>
        /// Just-in-time.
        /// </summary>
        JustInTime = 3,

        /// <summary>
        /// Designer-JSON.
        /// </summary>
        [EnumMember(Value = "designer-json")]
        DesignerHyphenJson = DesignerJson
    }

We generate documentation from source code it seems it didn't handle this enum correctly.

onstwedder commented 2 months ago

I am also using the CreatePipeline (CreatePipelineParameters says it wants a CreatePipelineConfigurationParameters.

The definition of that thing is "it's a type" in the documentation, but in reality: It is more like:

"configuration": {
    "path": "azure-pipelines.yml",
    "repository": {
        "id": "YourRepoGUID",
        "type": "azureReposGit"
    },
    "type": "yaml"
}, 

as mentioned here in stackoverflow.

And I got this API call working with that configuration, which makes me think that the autogenerating documentation tool might have a bug?