jsdoc hyphen in object key












2















An object is returned from an API which contains hyphen. I am having trouble documenting this with JSDoc in VS Code. In VS Code JSDoc, the hyphen and everything after the hyphen is the ignored. I have tried Object.<string, string> as well.



/**
* @typedef MyAPIResponse
* @type {object}
*
* @property {string} X-Request-Id
* @property {string} X-Correlation-Id
*/









share|improve this question

























  • Did you try to use @typedef syntax from the docs? Like @typedef {object} MyAPIResponse

    – Lesha Ogonkov
    Jan 2 at 11:16













  • huh, my example and the examples in the docs actually work in jsdoc from the commandline. It doesn't work in VS Code is my issue. Updated my question.

    – Chris McKnight
    Jan 2 at 17:40
















2















An object is returned from an API which contains hyphen. I am having trouble documenting this with JSDoc in VS Code. In VS Code JSDoc, the hyphen and everything after the hyphen is the ignored. I have tried Object.<string, string> as well.



/**
* @typedef MyAPIResponse
* @type {object}
*
* @property {string} X-Request-Id
* @property {string} X-Correlation-Id
*/









share|improve this question

























  • Did you try to use @typedef syntax from the docs? Like @typedef {object} MyAPIResponse

    – Lesha Ogonkov
    Jan 2 at 11:16













  • huh, my example and the examples in the docs actually work in jsdoc from the commandline. It doesn't work in VS Code is my issue. Updated my question.

    – Chris McKnight
    Jan 2 at 17:40














2












2








2








An object is returned from an API which contains hyphen. I am having trouble documenting this with JSDoc in VS Code. In VS Code JSDoc, the hyphen and everything after the hyphen is the ignored. I have tried Object.<string, string> as well.



/**
* @typedef MyAPIResponse
* @type {object}
*
* @property {string} X-Request-Id
* @property {string} X-Correlation-Id
*/









share|improve this question
















An object is returned from an API which contains hyphen. I am having trouble documenting this with JSDoc in VS Code. In VS Code JSDoc, the hyphen and everything after the hyphen is the ignored. I have tried Object.<string, string> as well.



/**
* @typedef MyAPIResponse
* @type {object}
*
* @property {string} X-Request-Id
* @property {string} X-Correlation-Id
*/






visual-studio-code jsdoc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 17:35







Chris McKnight

















asked Dec 28 '18 at 20:03









Chris McKnightChris McKnight

4,84542427




4,84542427













  • Did you try to use @typedef syntax from the docs? Like @typedef {object} MyAPIResponse

    – Lesha Ogonkov
    Jan 2 at 11:16













  • huh, my example and the examples in the docs actually work in jsdoc from the commandline. It doesn't work in VS Code is my issue. Updated my question.

    – Chris McKnight
    Jan 2 at 17:40



















  • Did you try to use @typedef syntax from the docs? Like @typedef {object} MyAPIResponse

    – Lesha Ogonkov
    Jan 2 at 11:16













  • huh, my example and the examples in the docs actually work in jsdoc from the commandline. It doesn't work in VS Code is my issue. Updated my question.

    – Chris McKnight
    Jan 2 at 17:40

















Did you try to use @typedef syntax from the docs? Like @typedef {object} MyAPIResponse

– Lesha Ogonkov
Jan 2 at 11:16







Did you try to use @typedef syntax from the docs? Like @typedef {object} MyAPIResponse

– Lesha Ogonkov
Jan 2 at 11:16















huh, my example and the examples in the docs actually work in jsdoc from the commandline. It doesn't work in VS Code is my issue. Updated my question.

– Chris McKnight
Jan 2 at 17:40





huh, my example and the examples in the docs actually work in jsdoc from the commandline. It doesn't work in VS Code is my issue. Updated my question.

– Chris McKnight
Jan 2 at 17:40












1 Answer
1






active

oldest

votes


















0














Resolved by using TypeScript declarations and triple slash directive.



Since I'm not using TypeScript in the project, I did the following:




  1. Create a folder for types

  2. Add triple slash directive to JavaScript file. Example: <reference path="./types/my-model.d.ts" /> or use jsconfig.json






share|improve this answer


























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53963751%2fjsdoc-hyphen-in-object-key%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Resolved by using TypeScript declarations and triple slash directive.



    Since I'm not using TypeScript in the project, I did the following:




    1. Create a folder for types

    2. Add triple slash directive to JavaScript file. Example: <reference path="./types/my-model.d.ts" /> or use jsconfig.json






    share|improve this answer






























      0














      Resolved by using TypeScript declarations and triple slash directive.



      Since I'm not using TypeScript in the project, I did the following:




      1. Create a folder for types

      2. Add triple slash directive to JavaScript file. Example: <reference path="./types/my-model.d.ts" /> or use jsconfig.json






      share|improve this answer




























        0












        0








        0







        Resolved by using TypeScript declarations and triple slash directive.



        Since I'm not using TypeScript in the project, I did the following:




        1. Create a folder for types

        2. Add triple slash directive to JavaScript file. Example: <reference path="./types/my-model.d.ts" /> or use jsconfig.json






        share|improve this answer















        Resolved by using TypeScript declarations and triple slash directive.



        Since I'm not using TypeScript in the project, I did the following:




        1. Create a folder for types

        2. Add triple slash directive to JavaScript file. Example: <reference path="./types/my-model.d.ts" /> or use jsconfig.json







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 23 at 23:05

























        answered Jan 23 at 21:35









        Chris McKnightChris McKnight

        4,84542427




        4,84542427
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53963751%2fjsdoc-hyphen-in-object-key%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

            How to fix TextFormField cause rebuild widget in Flutter