Code Monkey home page Code Monkey logo

intellij-swagger's People

Contributors

asaarilahti avatar cberg-zalando avatar cgrossde avatar dependabot[bot] avatar epaul avatar gayanper avatar gindex avatar gitter-badger avatar iabhi1995 avatar irishshagua avatar jakimarks avatar lappleapple avatar manuc66 avatar maxim-tschumak avatar merusso-regions avatar oleynikandrey avatar olivierkamers avatar radarsh avatar redmachine2 avatar rupert-madden-abbott avatar sambaranhazra avatar semonte avatar tkrop avatar viatra2 avatar vicky17d avatar ynodir avatar zeitlinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intellij-swagger's Issues

[YAML] Completion for referenced types should work even when '#' of json-pointer is not escaped

Consider:

swagger: 2.0
paths:
  /pets:
    get:
      responses:
        200:
          schema:
            $ref: #<caret>
definitions:
  Pets:
  Error:

Here, the # is recognised as a start of yaml comment, so no completion is currently suggested.
If user explicitly escaped '# then both #/definitions/Pets and #definitions/Error are correctly suggested.

However, the need for escaping of the # symbol is not obvious, so it would be nice if the same completion set would be suggested (and choosing one of them automatically escaped the reference).

Note that in this case user may only type sc<completion><enter>$<completion><enter>#<completion> to finish with the correct response definition

Auto-Refresh for browser preview

I have found this plugin the most convenient way for me to edit swagger files (i prefer it over the swagger-editor, for example).
What I'd really love to see is an auto-refresh feature for the excellent browser preview - so that whenever I save, the page in the browser reloads or updates the relevant parts, similar to what the various markdown plugins do.

Please upgrade the SwaggerUI distribution you use

Hi,

looks like the SwaggerUI distribution that you use is a bit dated and it seems to have problems with externalized schemas. When I try previewing, I just get

fetching resource list: ; Please wait.

and looking at the Chrome JS output reveals that there was an exception:

Uncaught TypeError: Cannot read property 'split' of null 

in line 261 of spec-converter.js.

This happens with both my own swagger files and with https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v2.0/yaml/petstore-separate/spec

Would be great if somebody could have a look and uplift the SwaggerUI version.

Thanks!

Completion for enumerated values

Consider the screenshot:
screen shot 2016-05-29 at 13 43 10

The set of values for parameter#in is enumerated, it should be suggested here (specifically query should be the only value matched by qu).

There is already existing @Ingore test in CaretCompletionTest#enumValuesCompletion_ParametersIn for this.

Completion for ```tags``` should suggest existing tags

Tags seems to be repititive by their nature in swagger.
Canonical Uber example has 5 tags fields with values: User, User, Estimates, Estimates and Products.

Probably it makes sense to suggest already existing tags when user tries to enter a new one

resolve splited swagger file and autocomplete

A blog article about "How to split a Swagger spec into smaller files"
1.It would be better if this plugin can resolve splited swagger files!Resolve means for $ref a relative path yaml,then we can click it like a hyperlink and jump to the target yaml file!
2.Also,when i edit User.yaml file which is mentioned in above article,autocomplete feature does not work...It would be good if autocomplete feature work in this situation!

IllegalArgumentException in JsonTraversal

In file: LightVirtualFile: /swagger.json: Argument for @NotNull parameter 'element' of com/intellij/json/psi/JsonPsiUtil.isPropertyKey must not be null
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'element' of com/intellij/json/psi/JsonPsiUtil.isPropertyKey must not be null
	at com.intellij.json.psi.JsonPsiUtil.isPropertyKey(JsonPsiUtil.java)
	at org.zalando.intellij.swagger.traversal.JsonTraversal.isKey(JsonTraversal.java:35)
	at org.zalando.intellij.swagger.traversal.JsonTraversal.getKeyNameIfKey(JsonTraversal.java:40)
	at org.zalando.intellij.swagger.validator.field.FieldsValidator.validate(FieldsValidator.java:25)
	at org.zalando.intellij.swagger.annotator.JsonValidKeyAnnotator.annotate(JsonValidKeyAnnotator.java:25)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:363)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:303)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:322)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:325)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:325)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:297)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:237)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:433)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1054)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:426)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:568)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:519)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:425)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:405)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:155)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)


java.lang.IllegalArgumentException: Argument for @NotNull parameter 'element' of com/intellij/json/psi/JsonPsiUtil.isPropertyKey must not be null
	at com.intellij.json.psi.JsonPsiUtil.isPropertyKey(JsonPsiUtil.java)
	at org.zalando.intellij.swagger.traversal.JsonTraversal.isKey(JsonTraversal.java:35)
	at org.zalando.intellij.swagger.traversal.JsonTraversal.getKeyNameIfKey(JsonTraversal.java:40)
	at org.zalando.intellij.swagger.validator.field.FieldsValidator.validate(FieldsValidator.java:25)
	at org.zalando.intellij.swagger.annotator.JsonValidKeyAnnotator.annotate(JsonValidKeyAnnotator.java:25)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:363)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:303)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:322)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:325)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:325)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:297)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:237)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:433)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1054)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:426)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:568)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:519)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:425)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:405)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:155)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

I use IDEA 2016.3 and swagger plugin v0.0.21.

swagger-php annonation

We use https://github.com/zircote/swagger-php and have annonation in our PHP files (prefixed to the implementing function), much like phpdoc. We find it very useful to document our fast evolving JSON REST API.

But right now this syntax in PhpStorm is just grey blob of text, so not very practical at all. Some code styling to help prevent syntax errors or typos. For me in particular quick navigation to definitions would be of use.

Is it feasable for the plugin to support these PHP annonations ?

Or might this be easyer to integrate in new, or other existing plugin like https://github.com/Haehnchen/idea-php-annotation-plugin (phpdoc) ?

Reference completion: don't mix parameters versus types

Consider

swagger: "2.0"
info:
  title: Test
  version: "1.0.0"
host: somewhere.com
basePath: /basePath
parameters:
  limitParam:
    name: limit
    in: query
    required: false
    type: integer
    format: int32
paths:
  /products:
    get:
      parameters:
        - $ref: <caret-1>
      responses:
        "200":
          description: description is required
          schema:
            type: array
            items:
              $ref: <caret-2>
definitions:
  Product:
    properties:
      product_id:
        type: string

Here <caret-1> can only reference parameters, while <caret-2> can only reference definitions.

However, plugin suggests both types of records (and something else) for both cases:

Parameters (note that allowEmptyValue is also questionable here):
screen shot 2016-05-28 at 13 44 47

Definitions:
screen shot 2016-05-28 at 13 46 41

Completion for standard swagger types

OAI spec supports the following types:

I would expect that plugin simplifies entering / editing the types

  • As a first step (covered by this issue), just basic completion of the exact type and format values shall be implemented.
  • Some additional logic for type vs format compatibility may be added, e.g if the type "number" is already set, then format "int32" should probably NOT be suggested, since it is only valid for "integer" type

Pluggin fails to load due to missing dependency. Pycharm CE

Using:
PyCharm Community Edition 2016.1.3
Build #PC-145.971, built on May 3, 2016
JRE: 1.8.0_40-release-b132 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

The plugin fails to load due to a missing dependency on org.jetbrains.plugins.yaml

screen shot 2016-05-15 at 21 58 50

incorrect validation cases

Affected Version: 0.0.11

Properties named 'contact'

In this example, "$ref" would be marked as invalid key:

"User": {
    "type": "object",
    "description": "User",
    "properties": {
        "contact": {
            "$ref": "#/definitions/Contact"
        }
    }
}

Suggestions for invalid field contain 'email', 'name', and 'url'. Changing property name to something else fixes the issue.

Array item descriptions

"ExampleList": {
    "type": "array",
    "description": "valid",
    "items": {
        "type": "string",
        "description": "invalid key"
    }
}

Unhandled exception while starting IntelliJ

It did not happen before 0.20 (if I remember well)

Every time I start IntelliJ I get this exception:

To reindex this file IDEA has to be restarted: com.intellij.openapi.fileTypes.impl.AbstractFileType cannot be cast to com.intellij.openapi.fileTypes.LanguageFileType
java.lang.ClassCastException: com.intellij.openapi.fileTypes.impl.AbstractFileType cannot be cast to com.intellij.openapi.fileTypes.LanguageFileType
at com.intellij.util.indexing.FileContentImpl.createFileFromText(FileContentImpl.java:97)
at com.intellij.util.indexing.FileContentImpl.getPsiFile(FileContentImpl.java:75)
at org.zalando.intellij.swagger.index.SwaggerDataIndexer.map(SwaggerDataIndexer.java:34)
at org.zalando.intellij.swagger.index.SwaggerDataIndexer.map(SwaggerDataIndexer.java:25)
at com.intellij.util.indexing.MapReduceIndex.update(MapReduceIndex.java:457)
at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1633)
at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$8(FileBasedIndexImpl.java:1559)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:505)
at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1516)
at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1501)
at com.intellij.util.indexing.UnindexedFilesUpdater.lambda$indexFiles$0(UnindexedFilesUpdater.java:107)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$0(CacheUpdateRunner.java:219)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1026)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$1(CacheUpdateRunner.java:236)
at com.intellij.openapi.progress.impl.CoreProgressManager$3.run(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:494)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:443)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:155)
at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:232)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

external JSON schema files not working -> update to newest Swagger-UI

I am using external JSON schema files (v3/v4 compliant) and also using your Swagger Plugin in PyCharm.
I found out, that the Swagger-UI provided by your plugin, does not work correctly with external json files.
E.g. the following response:

      responses:
        200:
          description: laboratory results
          schema:
            $ref: 'http://localhost/lab-result-1014.json'

Your plugin (and the integrated swagger-ui) returns nothing:
model schema

The newest swagger-ui returns the correct schema:
model schema pass

Thanks a lot!

Plugin not available for PHPStorm 10.0.4

Hey,

I tried to install your swagger plugin via the PHPStorm plugin repository but there's only version 0.0.1 available (which doesn't work. It's always grayed out after installing it):

image

So I downloaded the zip file with ne newest version (0.0.17) and tried to install it manually. But now it tells me:

image

What can I do to get it working?
Regards,
Verry

Definition not found. Invalid key.

Version 0.0.9 introduced following bugs/regressions in NodeJS projects:

  1. Response references in swagger.yaml are not resolved. Reported error: "Definition not found. Invalid key"
  2. All properties in "package.json" are highlighted red and reported as "Invalid key" errors.

All errors are gone if Swagger plugin is disabled.

swagger-yaml-error1
swagger-yaml-error2
swagger-yaml-error3

package-json-errors

WebStorm 2016.2 EAP incompatibility

From https://plugins.jetbrains.com/plugin/8347:

"I am unable to install plugin 0.0.13 (Plugin Swagger Plugin is incopatible with this installation) on WebStorm 2016.2 EAP Build #WS-162.917.18, built on June 15, 2016 JRE: 1.8.0_76-release-b216 x86 JVM: OpenJDK Server VM by JetBrains s.r.o Plugin version 0.0.2 from repository do not work. Is possible to fix it or are there any workaround? THX Lubor"

[JSON]: Completion for fields should add trailing comma when needed

Consider following completion:

{
  "swagger": "2.0",
  "info": {
    "tit<caret>
    "description": "Move your app forward with the Uber API",
    "version": "1.0.0"
  }
...

Completion for the field "title" is already implemented, but it would be nice if, after accepting the suggested field the final state would be:

{
  "swagger": "2.0",
  "info": {
    "title": "<caret>",
    "description": "Move your app forward with the Uber API",
    "version": "1.0.0"
  }
...

(note the added quotes, placement of cursor and added comma).

For YAML flow there is no additional required markup, so it seems to be JSON-specific enhancement

Support navigation to referenced files

From #48

"It would be better if this plugin can resolve splited swagger files!Resolve means for $ref a relative path yaml,then we can click it like a hyperlink and jump to the target yaml file!"

Support for reference properties

Auto completion should work with reference properties. For example, ../common.yaml#/definitions/Security or ../definitions.yaml#/Security. Swagger auto completion should work in referenced files.

  • JSON support for definitions (0fccef6)
  • JSON support for parameters (93d7cd8)
  • YAML support for definitions (7424e1f)
  • YAML support for parameters (b01e975)

Provide template for referencing the new schema definition

Consider:

swagger: 2.0
paths:
  /pets:
    get:
      responses:
        200:
          schema:
            $ref: '#<caret>
definitions:
  Pets:
  Error:

Here the actual code correctly suggests references for both Pets and Error.

However, it seems that for actual editing it is more common to have a per-response definitions (except may be a common error definitions). E.g, canonical Uber example contains 5 paths, each of them referencing its own unique definition (and a shared Error).

So it might be useful to provide additional "new-definition" template completion that would

  • insert #/definitions/<caret> at the $ref
  • additionally insert the new definition below under the (possibly not yet existing) definitions object
  • switch to rename mode, visually indicating to user that the new name being entered is also modified somewhere else
  • at the end, allow to move directly to the new definition to continue editing there

[Suggestion] provide an option to activate this plugin for arbitrary .yaml

Problem

I am currently writing swagger spec in multiple files and combine them before I use the swagger spec as follows:

├── swagger.yaml
└── yaml
    ├── definitions
    │   ├── book.yaml
    │   └── user.yaml
    └── index.yaml

In this example, swagger.yaml is concatenated file of book.yaml , user.yaml and index.yaml. In index.yaml , "swagger" field exists so this plugin is activated, while I can not use this plugin in book.yaml and user.yaml because they do not have "swagger" field.

Suggestion

Please provide optional comment to activate this plugin for files without swagger field as follows:

# intellij-swagger: activate

Compile error when trying to build via gradlew.bat runIdea

When I was trying to build the plugin by gradlew.bat runIdea, I ran into a compile error complaining:

E:\repos\intellij-swagger>gradlew.bat runIdea
:compileJava
E:\repos\intellij-swagger\src\main\java\org\zalando\intellij\swagger\ui\SwaggerUiUrlProvider.java:45: error: getUrl(OpenInBrowserRequest,VirtualFile) in SwaggerUiUrlProvider cannot override getUrl(OpenInBrowserRequest,VirtualFile) in BuiltInWebBrowserUrlProvider
    protected Url getUrl(@NotNull OpenInBrowserRequest request, @NotNull VirtualFile file) throws BrowserException {
                  ^
  overridden method does not throw BrowserException
1 error
:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.721 secs

E:\repos\intellij-swagger>

I tried cleaning the temp dir for any gradle downloads as well as the .gradle dir under user folder, but same result.

Also, when I opened the source code and tried to go to the definition of the accused BuiltInWebBrowserUrlProvider, it opened a file called BuiltInWebBrowserUrlProvider.kt from C:\Users\gjyuan.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\LATEST-EAP-SNAPSHOT\94051ecd254e3276ca2ee955f8f888465e7724ee\ideaIC-LATEST-EAP-SNAPSHOT-sources.jar

The definition points to a kotlin file, is this expected?

[YAML] Allow non-sibling completion without need to correct an indentation

This is a generic feature for editing of the YAML document with known structure.
Consider the following:

swagger: "2.0"
info:
  title: Uber API
  version: "1.0.0"
  description: Move your app forward with the Uber API
  ho<caret>

Here user has just entered the last field of the info object, pressed enter and possibly now wants to get back to editing of the main object.

However, in order to enter e.g the host field, user is forced to get to the correct indentation level first, and only then she will be able to type ho<completion>.
It would be nice if the same would work without the need to correct an indentation.

Things to consider:

  • the feature should probably be activated only for editing of the last existing field of the sub-object
  • the feature should probably be activated only when some matching field name of the parent is started to be typed (so ho in the snippet is important, and the host completion would NOT be suggested if the last line were empty)

NPE in YamlTraversal

In file: LightVirtualFile: /apiv3-swagger.yaml
java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.Optional.<init>(Optional.java:96)
	at java.util.Optional.of(Optional.java:108)
	at org.zalando.intellij.swagger.traversal.YamlTraversal.getKeyNameIfKey(YamlTraversal.java:37)
	at org.zalando.intellij.swagger.validator.field.FieldsValidator.validate(FieldsValidator.java:25)
	at org.zalando.intellij.swagger.annotator.YamlValidKeyAnnotator.annotate(YamlValidKeyAnnotator.java:26)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.a(DefaultHighlightVisitor.java:139)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:102)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:363)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:303)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:322)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:325)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:86)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:325)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:297)
	at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:237)
	at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:433)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1054)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.c(PassExecutorService.java:426)
	at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:568)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:519)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.b(PassExecutorService.java:425)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:405)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:155)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
PyCharm 2016.3 EAP
Build #PY-163.7743.16, built on November 8, 2016
PyCharm EAP User
Expiration date: December 8, 2016
JRE: 1.8.0_112-release-408-b2 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

File causing the NPE:

https://github.com/bdaroz/the-blue-alliance/blob/18b6eec78fa3b45e14590ab7f9e37e944d7f25c2/static/apiv3-swagger.yaml

Rename support for definitions should either work or be disabled

Consider following sample:

swagger: 2.0
paths:
  /pets:
    get:
      responses:
        200:
          schema:
            $ref: '#/definitions/Pets'

definitions:
  Pe<caret>ts:

Here pressing Shift-F6 (for Refactor/Rename) opens Rename dialog as follows, leading to the expectation that rename will actually update the usages. (Especially now when the navigation from $ref to Pets is implemented).
screen shot 2016-05-26 at 23 09 35

However, entering PetsNew in the dialog only updates the declaration and not the usages.

Completion for $ref values

We should auto complete $ref values. For example

$ref: '#/definitions/P<caret>' should be completed to $ref: '#/definitions/Pets' if Pets definition exists.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.