Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #318
Closed
Open
Issue created Jun 14, 2018 by Administrator@rootContributor

[rust-server] lacks support for `additionalProperties`

Created by: bjgill

Description

See https://github.com/swagger-api/swagger-codegen/issues/8089#issuecomment-389117445 - our main bar to using the same swagger spec for sample generation as the other generators is that rust-server does not yet support additionalProperties.

Admittedly, this seems like a non-trivial problem. rust-server is intended to provide a distributed strongly-typed system. As soon as you add additionalProperties, however, we lose the ability to be able to verify the contents of said additional properties.

A naive solution might be:

struct Foo {
    bar: Option<i32>,
    additionalProperties: HashMap<String, json::Object>,
};

However, this will fail as soon as we introduce non-json media types (e.g. XML, which rust-server supports). As such, I'm not sure what a complete solution would look like...

openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Assignee
Assign to
Time tracking