Skip to content


Subversion checkout URL

You can clone with
Download ZIP


java-play2: api changes should recompile on browser refresh #32

seantbrady opened this Issue · 7 comments

3 participants


This is an enhancement request. One of the big advantages of Play is recompilation of changed classes on browser refresh. The development cycle is extremely rapid. Unfortunately, it doesn't seem that changes to API annotations cause the supporting swagger classes to recompile on browser refresh. This means the app needs to be restarted to see API changes take effect.

Maybe someone from the Play team (@pk11) would be able to help.


I agree, something with the reload mechanism is missing a cached object. Will investigate...


Brute forcing it works for now:

I added a reset() method to ApiHelpInventory and then call it from Global.onStart(...)

def reset = {

onstart(...) {


@seantbrady That seems like a reasonable workaround, although we probably need a reset method in PlayApiReader too.

In play2 the compilation is handled by SBT so other than your Global.onStart approach (or writing a sbt plugin?!) I'm not sure whats the hook swagger-play2 can tap into to expire that cache. In play1 there are hooks which get called back when classes change.


@seantbrady This commit should address this. Please reopen with more details if you encounter problems with it.

@ayush ayush closed this

thanks @ayush!

@ayush ayush reopened this

still fixing. some loose ends on this.


ok, try now.

@ayush ayush closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.