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.

Improper code generation when a property is resolved to be Map<String, ANonYetExistingObject>

See original GitHub issue

I have the following field in my JSON Schema:

"metrics": {
          "type": "object",
          "description": "",
          "additionalProperties": {
            "$ref": "#/definitions/istio_adapter_dogstatsd_Params_MetricInfo",
            "javaType": "me.snowdrop.istio.adapter.dogstatsd.MetricInfo"
          },
          "javaType": "java.util.Map\u003cString,me.snowdrop.istio.adapter.dogstatsd.MetricInfo\u003e"
        },

This properly creates a Map<String,MetricInfo> with a proper import, however, the ref is never resolved and therefore the MetricInfo class is never created, even though the schema properly contains a istio_adapter_dogstatsd_Params_MetricInfo definition. The issue seems to be in ObjectRule.createClass in particular this part which resolves the type as Map and throws ClassAlreadyExistsException.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
piyush-gargcommented, Jun 4, 2018

Thanks, works for me that way.

2reactions
joelittlejohncommented, Jun 4, 2018

If you simply add a top-level schema file with a $ref to #/definitions/kubernetes_apiextensions_JSONSchemaPropsOrStringArray then the type you need will be generated. Then you can refer to it in the same way in your Map definition.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual studio shows endless messages "Code generation for ...
Code generation for property 'valueMember' failed. Error was: 'Object reference not set to an instance of an object.' This happens now often ...
Read more >
PROPERTY CODE TITLE 1. GENERAL PROVISIONS ...
(b) A manufactured home is real property if: (1) the statement of ownership and location for the home issued under Section 1201.207, Occupations ......
Read more >
Resolve property matching issues - Hotel Center Help
A property matching issue occurs when your property is “Not matched” because Google was unable to find a Google Maps location for your...
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