question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

define default values in openapi spec

See original GitHub issue

NetBox version

v2.11.1

Feature type

Data model extension

Proposed functionality

It would be nice if the default values for each property (if any) are also defined in the Netbox OpenAPI spec. They are, so far I can see, not defined for each and every object.

For example:

        "status": {
          "title": "Status",
          "type": "string",
          "enum": [
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned"
          ]
        },

could be defined as

        "status": {
          "title": "Status",
          "type": "string",
          "default": "active",
          "enum": [
            "planned",
            "provisioning",
            "active",
            "offline",
            "deprovisioning",
            "decommissioned"
          ]
        },

Since active value for status is the default returned by the API.

Use case

This helps us updating various netbox resources using OpenAPI libs.

Database changes

No response

External dependencies

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
github-actions[bot]commented, Feb 11, 2022

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Describing Parameters - Swagger
Use the default keyword in the parameter schema to specify the default value for an optional parameter. The default value is the one...
Read more >
Can a swagger object passed as a parameter have default ...
default - The default value represents what would be assumed by the consumer of the input as the value of the schema if...
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, ... the default value would be a Server Object with a url value of / ....
Read more >
OpenAPI Specification
The Swagger specification defines a set of files required to describe such an ... Otherwise, the property MAY be included and its default...
Read more >
Using OpenAPI and Swagger UI - Quarkus
An OpenAPI document that conforms to the OpenAPI Specification is itself a valid JSON object, ... Function to set default values to each...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found